assertUrlIsSecured('/timesheet/'); } public function testIndexAction() { $client = $this->getClientForAuthenticatedUser(); $this->request($client, '/timesheet/'); $this->assertTrue($client->getResponse()->isSuccessful()); $this->assertHasDataTable($client); } public function testCreateAction() { $client = $this->getClientForAuthenticatedUser(); $this->request($client, '/timesheet/create'); $this->assertTrue($client->getResponse()->isSuccessful()); // TODO more tests } public function testCreateActionWithFromAndToValues() { $client = $this->getClientForAuthenticatedUser(); $this->request($client, '/timesheet/create?from=2018-08-02T20%3A00%3A00&to=2018-08-02T20%3A30%3A00'); $this->assertTrue($client->getResponse()->isSuccessful()); // TODO more tests } public function testEditAction() { $client = $this->getClientForAuthenticatedUser(); $em = $client->getContainer()->get('doctrine.orm.entity_manager'); $fixture = new TimesheetFixtures(); $fixture->setAmount(10); $fixture->setUser($this->getUserByRole($em, User::ROLE_USER)); $fixture->setStartDate('2017-05-01'); $this->importFixture($em, $fixture); $this->request($client, '/timesheet/1/edit'); $response = $client->getResponse(); $docuUrl = $this->createUrl('/help/timesheet'); $this->assertTrue($response->isSuccessful()); $this->assertContains( '', $response->getContent(), 'Could not find link to documentation' ); // TODO more tests } }