diff --git a/module/CLI/test/Factory/InstallApplicationFactoryTest.php b/module/CLI/test/Factory/InstallApplicationFactoryTest.php index 35820bba..c7e87bc7 100644 --- a/module/CLI/test/Factory/InstallApplicationFactoryTest.php +++ b/module/CLI/test/Factory/InstallApplicationFactoryTest.php @@ -1,6 +1,4 @@ name = $name; + } + /** * @return string */ diff --git a/module/Core/test/Service/Tag/TagServiceTest.php b/module/Core/test/Service/Tag/TagServiceTest.php index 2a629c4f..d111afbb 100644 --- a/module/Core/test/Service/Tag/TagServiceTest.php +++ b/module/Core/test/Service/Tag/TagServiceTest.php @@ -1,6 +1,4 @@ tagService = $this->prophesize(TagServiceInterface::class); + $this->action = new ListTagsAction($this->tagService->reveal()); + } + + /** + * @test + */ + public function returnsDataFromService() + { + /** @var MethodProphecy $listTags */ + $listTags = $this->tagService->listTags()->willReturn([new Tag('foo'), new Tag('bar')]); + + $resp = $this->action->process( + ServerRequestFactory::fromGlobals(), + $this->prophesize(DelegateInterface::class)->reveal() + ); + + $this->assertEquals([ + 'tags' => [ + 'data' => ['foo', 'bar'], + ], + ], \json_decode((string) $resp->getBody(), true)); + $listTags->shouldHaveBeenCalled(); + } +}