【发布时间】:2017-05-30 15:16:50
【问题描述】:
我正在 Vagrant VM 上开发 CakePHP 3.x 项目。我的项目有一个控制器测试。项目是使用 composer 设置的,phpunit 安装在 vendor 目录中。
运行 ./vendor/bin/phpunit 测试会引发以下错误:
[vagrant@devenv-lamp ~/www]$ ./vendor/bin/phpunit Tests
PHP Fatal error: Interface 'PHPUnit\Framework\TestListener' not found in /vagrant/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 30
Fatal error: Interface 'PHPUnit\Framework\TestListener' not found in /vagrant/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 30
我也尝试为单个控制器运行 PHPUnit - 结果相同...
[vagrant@devenv-lamp ~/www]$ ./vendor/bin/phpunit tests/TestCase/Controller/QuestionsControllerTest.php
PHP Fatal error: Interface 'PHPUnit\Framework\TestListener' not found in /vagrant/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 30
Fatal error: Interface 'PHPUnit\Framework\TestListener' not found in /vagrant/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 30
我对 PHPUnit 很陌生,即使没有起飞,我也会撞墙。这里的任何帮助将不胜感激。
【问题讨论】:
标签: testing phpunit listener cakephp-3.0 fatal-error