Link to the repository
[Only for premium members]
[Only for premium members]
The next thing I usually check is whether the project has tests. It means I can try to modify the code and run the tests to check if I didn't break anything.
And we do have some tests here:
But when I try to run them, I get an error:
Well, yeah, I don't see the tests/Unit
folder. And don't get me wrong: it's totally fine NOT to have Unit tests, staying only with Feature tests. But the default Laravel comes with the example Unit test:
tests/Unit/ExampleTest.php:
namespace Tests\Unit; use PHPUnit\Framework\TestCase; class ExampleTest extends TestCase{ /** * A basic test example. */ public function test_that_true_is_true(): void { $this->assertTrue(true); }}
In this case, the code author has deleted that example test with the full folder of tests/Unit
. It may be fine, but the problem is that testing is still configured to run tests from the tests/Unit
folder, which doesn't exist anymore:
phpunit.xml
<testsuites> <testsuite name="Unit"> <directory>tests/Unit</directory> </testsuite> <testsuite name="Feature"> <directory>tests/Feature</directory> </testsuite></testsuites>
So, we have two choices here:
tests/Unit
empty folder