yiisoft / yii2-redis

Yii 2 Redis extension.
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
451 stars 184 forks source link

Weird class resolution in tests #138

Closed zhukovra closed 6 years ago

zhukovra commented 6 years ago

What steps will reproduce the problem?

Run tests on master in Travis CI again.

What's expected?

PhpUnit tests finish with success.

What do you get instead?

Unit tests fail (example)

Additional info

There is strange class resolution with file_put_contents() in PhpUnit bootstrap. Updated classes in yiisoft/yii2 repository breaks unit tests:

PHP Fatal error:  Class 'yiiunit\data\ar\CustomerWithAlias' not found in /home/travis/build/zhukovra/yii2-redis/tests/ActiveRecordTestTrait.php on line 280
PHP Stack trace:
PHP   1. {main}() /home/travis/.phpenv/versions/5.4.45/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /home/travis/.phpenv/versions/5.4.45/bin/phpunit:563
PHP   3. PHPUnit_TextUI_Command->run() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/TextUI/Command.php:100
PHP   4. PHPUnit_TextUI_TestRunner->doRun() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/TextUI/Command.php:149
PHP   5. PHPUnit_Framework_TestSuite->run() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/TextUI/TestRunner.php:440
PHP   6. PHPUnit_Framework_TestSuite->run() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestSuite.php:722
PHP   7. PHPUnit_Framework_TestCase->run() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestSuite.php:722
PHP   8. PHPUnit_Framework_TestResult->run() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestCase.php:724
PHP   9. PHPUnit_Framework_TestCase->runBare() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestResult.php:612
PHP  10. PHPUnit_Framework_TestCase->runTest() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestCase.php:768
PHP  11. ReflectionMethod->invokeArgs() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestCase.php:909
PHP  12. yiiunit\extensions\redis\ActiveRecordTest->testRefresh_querySetAlias_findRecord() phar:///home/travis/.phpenv/versions/5.4.45/bin/phpunit/phpunit/Framework/TestCase.php:909

Solution

I think wrong any variant with fetching files from bootstrap.php. @cebe, @samdark, what you think about it?