What happens when you run phpunit tests/Unit/UserTest.php?
The problem might be in another test right? If you run phpunit it will run all tests of your application.
Odd behavior that could be coming from the not doing it correctly place. I'm also not sure what all information would help keep this succinct yet cover the issue - updates will be added ass necessary.
Consider a vanilla Laravel install.
// UserTest.php
class UserTest extends TestCase
{
use RefreshDatabase;
public function testOne()
{
$user = User::make(['email' => '[email protected]']);
$user->save();
$this->assertTrue($user->id == 1);
}
public function testTwo()
{
$user = User::make(['email' => '[email protected]']);
$user->save();
$this->assertTrue($user->id == 1);
}
}
Running the tests one at a time, they both pass (phpunit --filter=testOne and phpunit --filter=testTwo). Run them sequentially, all but the first will error out with a timeout error (phpunit).
What's going on (I'd really like to understand the why)? And what's the fix?
What I've tried:
Would like to be as close to production-like as possible.
Please or to participate in this conversation.