request = $this->makeEmpty(Request::class); } /** * @throws NotDatabasesException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws Exception */ public function testConstructWithNonDatabase(): void { $this->container = $this->makeEmpty(ContainerInterface::class, [ 'has' => false ]); $this->expectException(NotDatabasesException::class); new WorkingHoursViewController($this->container); } /** * @throws NotDatabasesException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws Exception */ public function testBrowseMonthly(): void { $controller = new WorkingHoursViewController($this->container); $response = $controller->browseMonthly($this->request, $this->response, []); $this->assertEquals(self::FICTIONAL_STATUS_CODE, $response->getStatusCode()); $this->assertNotEmpty($response->getBody()->getContents()); } /** * @throws NotDatabasesException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws Exception */ public function testBrowseYearly(): void { $controller = new WorkingHoursViewController($this->container); $response = $controller->browseYearly($this->request, $this->response, []); $this->assertEquals(self::FICTIONAL_STATUS_CODE, $response->getStatusCode()); $this->assertNotEmpty($response->getBody()->getContents()); } /** * @throws NotDatabasesException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws Exception */ public function testBrowseWeekly(): void { $controller = new WorkingHoursViewController($this->container); $response = $controller->browseWeekly($this->request, $this->response, []); $this->assertEquals(self::FICTIONAL_STATUS_CODE, $response->getStatusCode()); $this->assertNotEmpty($response->getBody()->getContents()); } }