PHPUnit - The test case was unexpectedly terminated: Debug Error: Class not found: Interface not found

StackOverflow https://stackoverflow.com/questions/21168047

سؤال

I get this class of error: Debug Error: Class/Interface not found And more abstract one from PHPUnit: The test case was unexpectedly terminated.

Specific Example:

Debug Error: /vendor/bjyoungblood/bjy-authorize/src/BjyAuthorize/Provider/Role/ZendDb.php line 22 - Interface 'BjyAuthorize\Provider\Role\ProviderInterface' not found

Steps to Reproduce

using Zend Studio 10.5.0 on PHP Version - 5.4 on Windows 7 64

  • Create a new workspace (File -> Switch Workspace -> Other). You can always switch back.
  • Create a Local PHP Project (File -> New -> Local PHP Project)
  • Switch to directory where the project files are located
  • From command line or console, Run:
php composer.phar self-update
php composer.phar update
php composer.phar require bjyoungblood/bjy-authorize:1.4.*
  • In Studio, go to the /vendor/bjyoungblood/bjy-authorize/tests folder, Right Click -> Run As -> PHPUnit Test
  • A similar error will be issued.

In my case it was:

Debug Error: /vendor/bjyoungblood/bjy-authorize/tests/BjyAuthorizeTest/Provider/Role/ZendDbTest.php line 38 - Class 'BjyAuthorize\Provider\Role\ZendDb' not found

The class is located here: /vendor/bjyoungblood/bjy-authorize/BjyAuthorize/Provider/Role/ZendDb.php, but PHPUnit is not finding it.

Other observations

It appears to me that PHPUnit is not namespace aware, or maybe it is an autoloader issue, or PHPUnit Bootstrap.php issue, or PHPUnit TestConfiguration.php issue.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top