Last active
May 16, 2024 13:07
-
-
Save michabbb/279af3eea6029e7621e68edbc87cc89a to your computer and use it in GitHub Desktop.
PestPHP architecture testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @see https://www.linkedin.com/posts/ashleyjcallen_these-are-some-not-all-of-the-first-pest-activity-7191803157692190720-HAPK **/ | |
test('strict types are used everywhere') | |
->expect('App') | |
->toUseStrictTypes(); | |
test('globals') | |
->expect(['dd', 'ddd', 'die', 'dump', 'ray', 'sleep']) | |
->toBeUsedInNothing(); | |
test('models extends base model') | |
->expect('App\Models') | |
->toExtend(Model::class); | |
test('controllers') | |
->expect('App\Http\Controllers') | |
->toBeClasses() | |
->classes() | |
->toExtend(Controller::class); | |
test('commands') | |
->expect('App\Console\Commands') | |
->toBeClasses() | |
->toExtend(Command::class) | |
->toHaveMethod('handle'); | |
test('jobs') | |
->expect('App\Jobs') | |
->toBeClasses() | |
->toImplement(ShouldQueue::class) | |
->toHaveMethod('handle'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment