getClientForAuthenticatedUser(User::ROLE_USER); $em = $client->getContainer()->get('doctrine.orm.entity_manager'); $tagList = ['Test', 'Administration', 'Support', '#2018-001', '#2018-002', '#2018-003', 'Development', 'Marketing', 'First Level Support', 'Bug Fixing']; $fixture = new TagFixtures(); $fixture->setTagArray($tagList); $this->importFixture($em, $fixture); } public function testDebugIsSecure() { $this->assertUrlIsSecured('/admin/tags/'); } public function testIndexAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->assertAccessIsGranted($client, '/admin/tags/'); $this->assertHasDataTable($client); $this->assertDataTableRowCount($client, 'datatable_admin_tags', 10); } public function testIndexActionWithSearchTermQuery() { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->request($client, '/admin/tags/'); $this->assertTrue($client->getResponse()->isSuccessful()); $form = $client->getCrawler()->filter('form.header-search')->form(); $client->submit($form, [ 'searchTerm' => 'Support', ]); $this->assertTrue($client->getResponse()->isSuccessful()); $this->assertHasDataTable($client); $this->assertDataTableRowCount($client, 'datatable_admin_tags', 2); } }