service = $this->prophesize(DeleteShortUrlServiceInterface::class); $this->action = new DeleteShortUrlAction($this->service->reveal()); } /** @test */ public function emptyResponseIsReturnedIfProperlyDeleted(): void { $deleteByShortCode = $this->service->deleteByShortCode(Argument::any())->will(function (): void { }); $resp = $this->action->handle(new ServerRequest()); $this->assertEquals(204, $resp->getStatusCode()); $deleteByShortCode->shouldHaveBeenCalledOnce(); } }