我用composer創建了一個cakephp3項目。這是從何而來的致命錯誤? cakephp phpunit
composer create-project --prefer-dist cakephp/app foobar
然後,我烤了一個幫手與
bin/cake bake helper Progress
而且在CakePHP的testing tutorial 目錄切換和執行phpunit
copypasted幫手,例如說
PHP Fatal error: Class Cake\TestSuite\Fixture\FixtureInjector contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addWarning) in /home/matthias/www/isbn.localhost/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 173
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:42
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:138
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:186
PHP 5. PHPUnit_TextUI_TestRunner->handleConfiguration() /home/matthias/www/foobar/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:145
PHP 6. require_once() /home/matthias/www/foobar/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:771
Fatal error: Class Cake\TestSuite\Fixture\FixtureInjector contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addWarning) in /home/matthias/www/foobar/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 173
Call Stack:
0.0001 225152 1. {main}() /usr/bin/phpunit:0
0.0031 515440 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:42
0.0031 516064 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:138
0.6384 6931096 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:186
0.6384 6932312 5. PHPUnit_TextUI_TestRunner->handleConfiguration() /home/matthias/www/foobar/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:145
0.6458 7043088 6. require_once('/home/matthias/www/foobar/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php') /home/matthias/www/foobar/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:771
不如果使用全球安裝的phpunit 4.2.6或使用Composer安裝的最新版本,則需要考慮。這是從哪裏來的,以及如何解決這個問題?
非常感謝!
Works perfekt!謝謝。 –
@MatthiasMoritz幾個小時前我剛剛看到[** CakePHP更新了**](https://github.com/cakephp/cakephp/pull/7355)以支持PHPUnit的更改。不過,如果你真的沒有特別的理由來使用不穩定的5.x分支,那麼使用穩定的4.x分支最好。 – ndm