Last active
January 5, 2024 01:01
-
-
Save mmouih/79d7b661a27501ffb102f6d4cd6e3cbf to your computer and use it in GitHub Desktop.
Controllers Tests with pest
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 Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
arch('controllers must has "Controller" as suffix') | |
->expect('App\Controller') | |
->toHaveSuffix('Controller'); | |
arch(sprintf('constroller must extends %s', AbstractController::class)) | |
->expect('App\Controller') | |
->toExtend(AbstractController::class); | |
arch('Controllers cannot be used anywhere') | |
->expect('App\Controller') | |
->toBeUsedInNothing(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment