Skip to content

Instantly share code, notes, and snippets.

@mmouih
Created January 5, 2024 00:32
Show Gist options
  • Save mmouih/6ca5d23979cedf7a7a208c6be7c039bf to your computer and use it in GitHub Desktop.
Save mmouih/6ca5d23979cedf7a7a208c6be7c039bf to your computer and use it in GitHub Desktop.
Testing handlers
<?php
use App\Handler\CreateOrUpdateUserHandler;
use App\Handler\HandlerInterface;
arch(sprintf('CreateOrUpdateUserHandler must implement %s', HandlerInterface::class))
->expect(CreateOrUpdateUserHandler::class)
->toImplement(HandlerInterface::class);
arch('handlers must be final')
->expect('App\Handler')
->classes
->toBeFinal();
arch(sprintf('All classes from Namespace App\Handler implement %s', HandlerInterface::class))
->expect('App\Handler')
->toImplement(HandlerInterface::class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment