| Subject | Details |
| :------------- | :---------------------------------------------------------------|
| Rector version | 0.8 (master) |
| Installed as | git clone |
Rector tests are red when installed with composer --prefer-lowest, as rector uses API which is available in newest packaes.
One example is symfony/dependency injection. Recent rector allow symfony/dependency-injection: ^4.4.8|^5.0.6 and
Symfony\Component\DependencyInjection\Loader\Configurator\inline_service is available only since Symfony 5.1 (before the method has different name if I read it correctly the 5.1 changelog: https://github.com/symfony/dependency-injection/blob/34eefcfff4ff4e628f6571f4460b0825e5e7e47b/CHANGELOG.md#510)
So the test is failing with
2) Rector\MysqlToMysqli\Tests\SetTest::test with data set #0 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Error: Call to undefined function Symfony\Component\DependencyInjection\Loader\Configurator\inline_service()
git clone [email protected]:rectorphp/rector.git
cd rector
composer update --prefer-lowest
./vendor/bin/phpunit
Tests are green.
Rector is tested in CI (github actions ) also with lowest dependencies
Thanks for very detailed report :heart:
With such a clear and narrow error message, I could find the fix in matter of 1 minute.
Does this help?
https://github.com/rectorphp/rector/pull/4219
Hi
@TomasVotruba it did help, however there is (I believe) similar issue with other function:
115) Rector\TypeDeclaration\Tests\Rector\FunctionLike\ReturnTypeDeclarationRector\ReturnTypeDeclarationRectorTest::test with data set #8 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
BadMethodCallException: No such method: isAOf
I think the method isAOf comes from "webmozart/assert": "^1.0", however it was introduced in webmozart/assert 1.7:
https://github.com/webmozart/assert/commits/master

Another issue is:
1) Rector\NetteCodeQuality\Tests\Rector\ArrayDimFetch\ChangeControlArrayAccessToAnnotatedControlVariableRector\ChangeControlArrayAccessToAnnotatedControlVariableRectorTest::test with data set #0 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Error: Class 'Rector\NetteCodeQuality\Tests\Rector\ArrayDimFetch\ChangeControlArrayAccessToAnnotatedControlVariableRector\Fixture\SomeParentPresenter' not found
/tmp/_temp_fixture_easy_testing/input_70a8686c7fe47c5d8e64_on_parent_create_component.php:8
/home/tymoteusz/Projects/benefit/rector/rector/vendor/symplify/easy-testing/src/StaticFixtureSplitter.php:47
/home/tymoteusz/Projects/benefit/rector/rector/src/Testing/PHPUnit/AbstractRectorTestCase.php:47
/home/tymoteusz/Projects/benefit/rector/rector/rules/nette-code-quality/tests/Rector/ArrayDimFetch/ChangeControlArrayAccessToAnnotatedControlVariableRector/ChangeControlArrayAccessToAnnotatedControlVariableRectorTest.php:19
But I didn't manage to quickly identify the root cause.
I think @staabm solved this in
https://github.com/rectorphp/rector/pull/4220
Yep
Thanks a lot!