Update / My Solution:
I accidentally didn't remove the VCS require from my composer.json before testing with the "autoload" key. It's now my understanding (based on what just happened) that the autoload section of composer.json is processed at runtime. If this is correct I may have solved my problem. (false, but a InvalidArgumentException exception will be thrown by PHP if the trailing "\\" is missing from the namespace name, hence the confusion)
The PSR-4 autoloader is independant of the git repository and does not require me to commit changes before testing, so this solution is sufficient for my purposes.
I'm going to leave this question open for now in case somebody has an answer to my question in broader terms. (i.e. answer to the question as stated in the title)
The Problem:
I'm attempting to build something primarily for use on a specific project, but as I think it will be useful to others I've decided to make it a Composer package.
What I want to do is develop the composer package on a git repository, and do manual testing inside my own project where I'm using the package.
The solutions I've found are as follows, but neither are sufficient:
Include local Git repo as VCS repository in project's composer.json
The big issue with this method is that for every small change I make I need to commit changes before being able to test them. I'll wind up with tons of commits for my own silly syntax or api mistakes because I didn't test - not cool.
Move package folder into project folder and add it to project's "autoload" section in composer.json
Unfortunately this method has the same issue. I need to commit my changes if I want to perform manual testing, otherwise the following message appears when running "composer update": (see "Update / My Solution" header)
[RuntimeException]
Source directory /srv/http/my-project/vendor/my-package
has unpushed changes on the current branch:
M composer.json
A src/EditorApplication.php
Write a shell script that copies source files excluding git-related files from my source folder into the autoloaded folder in my project
There must be a way to do something so necessary in Composer without resorting to this. How do you test uncommited changes to a composer package without doing the implementation inside the package itself? Is it even possible?