mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
feat: more presets rules
This commit is contained in:
@ -16,13 +16,6 @@ final class Laravel extends AbstractPreset
|
|||||||
*/
|
*/
|
||||||
public function execute(): void
|
public function execute(): void
|
||||||
{
|
{
|
||||||
$this->expectations[] = expect([
|
|
||||||
'dd',
|
|
||||||
'ddd',
|
|
||||||
'env',
|
|
||||||
'exit',
|
|
||||||
])->not->toBeUsed();
|
|
||||||
|
|
||||||
$this->expectations[] = expect('App')
|
$this->expectations[] = expect('App')
|
||||||
->not->toBeEnums()
|
->not->toBeEnums()
|
||||||
->ignoring('App\Enums');
|
->ignoring('App\Enums');
|
||||||
@ -81,7 +74,8 @@ final class Laravel extends AbstractPreset
|
|||||||
|
|
||||||
$this->expectations[] = expect('App\Mail')
|
$this->expectations[] = expect('App\Mail')
|
||||||
->classes()
|
->classes()
|
||||||
->toExtend('Illuminate\Mail\Mailable');
|
->toExtend('Illuminate\Mail\Mailable')
|
||||||
|
->toImplement('Illuminate\Contracts\Queue\ShouldQueue');
|
||||||
|
|
||||||
$this->expectations[] = expect('App')
|
$this->expectations[] = expect('App')
|
||||||
->not->toExtend('Illuminate\Mail\Mailable')
|
->not->toExtend('Illuminate\Mail\Mailable')
|
||||||
@ -91,10 +85,7 @@ final class Laravel extends AbstractPreset
|
|||||||
->classes()
|
->classes()
|
||||||
->toImplement('Illuminate\Contracts\Queue\ShouldQueue')
|
->toImplement('Illuminate\Contracts\Queue\ShouldQueue')
|
||||||
->toUseTraits([
|
->toUseTraits([
|
||||||
'Illuminate\Bus\Queueable',
|
'Illuminate\Foundation\Queue\Queueable',
|
||||||
'Illuminate\Foundation\Bus\Dispatchable',
|
|
||||||
'Illuminate\Queue\InteractsWithQueue',
|
|
||||||
'Illuminate\Queue\SerializesModels',
|
|
||||||
])->toHaveMethod('handle');
|
])->toHaveMethod('handle');
|
||||||
|
|
||||||
$this->expectations[] = expect('App\Listeners')
|
$this->expectations[] = expect('App\Listeners')
|
||||||
@ -116,5 +107,13 @@ final class Laravel extends AbstractPreset
|
|||||||
->not->toExtend('Illuminate\Support\ServiceProvider')
|
->not->toExtend('Illuminate\Support\ServiceProvider')
|
||||||
->not->toHaveSuffix('ServiceProvider')
|
->not->toHaveSuffix('ServiceProvider')
|
||||||
->ignoring('App\Providers');
|
->ignoring('App\Providers');
|
||||||
|
|
||||||
|
$this->expectations[] = expect([
|
||||||
|
'dd',
|
||||||
|
'ddd',
|
||||||
|
'env',
|
||||||
|
'exit',
|
||||||
|
'ray',
|
||||||
|
])->not->toBeUsed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user