expectException(NotFoundException::class); $fooController->get($request); } /** * @throws NotFoundException */ public function testPost(): void { $fooController = new FooController(); $request = new ServerRequest('GET', '/foo'); $this->expectException(NotFoundException::class); $fooController->post($request); } /** * @throws NotFoundException */ public function testDelete(): void { $fooController = new FooController(); $request = new ServerRequest('GET', '/foo'); $this->expectException(NotFoundException::class); $fooController->delete($request); } /** * @throws NotFoundException */ public function testPatch(): void { $fooController = new FooController(); $request = new ServerRequest('GET', '/foo'); $this->expectException(NotFoundException::class); $fooController->patch($request); } } class FooController extends Controller { }