Page MenuHomeDevCentral

Arcanist ignores phpunit.xml to run unit tests in OmniTools
Closed, ResolvedPublic

Description

When arc unit runs after a change to src/Reflection/CodeFile.php, the tests are marked as broken.

If the tests are run without using phpunit.xml, the following error indeed occurs:

Fatal error: Trait 'Keruald\OmniTools\Tests\WithData' not found in /usr/home/dereckson/dev/keruald/omnitools/tests/Reflection/CodeFileTest.php on line 14

Event Timeline

dereckson triaged this task as High priority.Jan 28 2020, 07:17
dereckson created this task.

This error occurs when tests are run from the tests/ folder:

$ cd tests
$ phpunit .

Fatal error: Trait 'Keruald\OmniTools\Tests\WithData' not found in /usr/home/dereckson/dev/keruald/omnitools/tests/Reflection/CodeFileTest.php on line 14

In root folder, phpunit.xml includes bootstrap="vendor/autoload.php" attribute to the phpunit tag. This allows to load following PSR-4 the objects in the Keruald\OmniTools\Tests namespace.

arc unit doesn't take in consideration phpunit.xml

dereckson renamed this task from WithData trait missing in CodeFileTest class to Arcanist ignores phpunit.xml to run unit tests.Jan 28 2020, 10:22
dereckson renamed this task from Arcanist ignores phpunit.xml to run unit tests to Arcanist ignores phpunit.xml to run unit tests in OmniTools.