Closed web-commerce-og closed 1 year ago
Thanks for the report. We cannot reproduce unfortunately.
Here is what I did to verify that alias map is not an issue in composer based setups we use:
git clone https://github.com/IchHabRecht/filefill.git
cd filefill
git checkout 4.1.1
composer update
# confirm requests to allow plugins manually
.Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --testsuite unit
# unit tests run successfully
composer req mask/mask:*
# friendsoftypo3/fontawesome-provider will be installed as well, as it is required by mask
.Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --testsuite unit
# unit tests still run successfully
Filefill does nothing exciting here. Pure Composer based setup, TYPO3 and Nimut Testingframework is required and used.
How exactly is your setup when running into the issue you are describing?
If the Autoload-Information is already generated this step is skipped. See AbstractBootstrap.php#L260
You have to rm -r .Build/public/typo3conf/autoload-tests
before running the tests again.
git clone https://github.com/IchHabRecht/filefill.git
cd filefill
git checkout 4.1.1
composer update
# confirm requests to allow plugins manually
.Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --testsuite unit
# unit tests run successfully
composer req mask/mask:*
rm -r .Build/public/typo3conf/autoload-tests
# friendsoftypo3/fontawesome-provider will be installed as well, as it is required by mask
.Build/bin/phpunit --bootstrap .Build/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php --testsuite unit
Thanks @Tim-Obert for a way to reproduce it.
You actually unveiled a bug in friendsoftypo3/fontawesome-provider, which does not register the class aliases in its composer.json file, as documented, which in fact leads to the alias not working for Composer installations and also indirectly causing the issue you are seeing here.
With this bug fixed in that extension, the testing framework should work just fine without any changes.
General Information:
TYPO3 11 typo3-composer-installers: 3
The Problem
When starting an UnitTest with a command like:
.Build/bin/phpunit -c .Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml Tests/Unit/
everything works as expected until you add an extension that provides an alias for a class. An example would be friendsoftypo3/fontawesome-provider. If this extension is added this exception is thrown:The file in
.Build/public/typo3conf/autoload-tests/autoload_classaliasmap.php
has now filled arrays so that the ClassAliasMap::$classaliasloader is needed which seems like it is not defined.