Created
August 14, 2024 01:19
-
-
Save nasrulhazim/1d2404cec8493beb1c363ed54c6024a1 to your computer and use it in GitHub Desktop.
Minimal Architecture Test using PestPHP
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 | |
use App\Contracts\Builder; | |
use App\Contracts\Menu; | |
it('runs on PHP 8.3 or above') | |
->expect(phpversion()) | |
->toBeGreaterThanOrEqual('8.3.0'); | |
it('does not use debugging functions') | |
->expect(['dd', 'dump', 'ray', 'var_dump', 'var_export']) | |
->not | |
->toBeUsed(); | |
it('does not using url method') | |
->expect(['url']) | |
->not | |
->toBeUsed(); | |
test('controllers') | |
->expect('App\Http\Controllers') | |
->toHaveSuffix('Controller'); | |
test('actions builder') | |
->expect('App\Actions\Builder') | |
->toImplement([Builder::class, Menu::class]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment