Build scalable Laravel apps without compromising code quality and the least amount of technical debt. Effortless code navigation, onboarding and reviews. Tailored for Microservices and mindful of Monoliths.
We can now mock unit instances that are written with the new PHP syntax the same as we did with the previous class string syntax:
$repo = $this->run(new GetGitHubRepoJob(id: $repoId, withReleases: false));
GetGitHubRepoJob::mock([
'id' => 'some-id-here',
'withReleases' => false,
])->shouldReturn($sampleRepo);
tests
directory, and will be distributed to tests/Feature
and tests/Unit
Unit | From | To |
---|---|---|
Feature | tests/Features/*Test.php |
tests/Feature/*Test.php |
app/Services/<service>/Tests/*Test.php |
tests/Feature/Services/<service>/*Test.php |
|
Operation | tests/Operations/*Test.php |
tests/Unit/Operations/*Test.php |
app/Services/<service>/Tests/Operations/*Test.php |
tests/Unit/Services/<service>/Operations/*Test.php |
|
Job | app/Domains/<domain>/Tests/Jobs/*Test.php |
tests/Unit/Domains/<domain>/Jobs/*Test.php |
Tests\...
instead of App\..\Tests\...
Str::snake
instead of mb_strtolower
(test_someawesomefeature
-> test_some_awesome_feature
for a feature called SomeAwesomeFeature
)