Skip to content

Instantly share code, notes, and snippets.

@mmouih
Last active January 5, 2024 01:01
Show Gist options
  • Save mmouih/79d7b661a27501ffb102f6d4cd6e3cbf to your computer and use it in GitHub Desktop.
Save mmouih/79d7b661a27501ffb102f6d4cd6e3cbf to your computer and use it in GitHub Desktop.
Controllers Tests with pest
<?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