Jun 1, 2023
0
Level 10
Move Pest to a different location
I'm trying to separate my code a bit and I want to move my pest feature test to ./features/<feature>/tests/Feature/<file>Test.php
I updated phpunit.xml with the added path:
<testsuite name="Feature">
<directory suffix="Test.php">./features/**/tests/Feature</directory>
</testsuite>
But running this test, which worked before, it fails
test('can run command', function () {
$this->artisan('test:command')->assertExitCode(0);
});
With the error:
Call to undefined method Features\<feature>\tests\Feature\CommandTest::artisan(). Did you forget to use the [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests
Please or to participate in this conversation.