improved tag auto-completion and added tag management (#1083)
This commit is contained in:
@@ -60,4 +60,39 @@ class TagControllerTest extends ControllerBaseTest
|
||||
$this->assertHasDataTable($client);
|
||||
$this->assertDataTableRowCount($client, 'datatable_admin_tags', 2);
|
||||
}
|
||||
|
||||
public function testCreateAction()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/tags/create');
|
||||
$form = $client->getCrawler()->filter('form[name=tag_edit_form]')->form();
|
||||
$client->submit($form, [
|
||||
'tag_edit_form' => [
|
||||
'name' => 'A tAG Name!',
|
||||
]
|
||||
]);
|
||||
$this->assertIsRedirect($client, $this->createUrl('/admin/tags/'));
|
||||
$client->followRedirect();
|
||||
$this->assertHasDataTable($client);
|
||||
|
||||
$this->request($client, '/admin/tags/11/edit');
|
||||
$editForm = $client->getCrawler()->filter('form[name=tag_edit_form]')->form();
|
||||
$this->assertEquals('A tAG Name!', $editForm->get('tag_edit_form[name]')->getValue());
|
||||
}
|
||||
|
||||
public function testEditAction()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/tags/1/edit');
|
||||
$form = $client->getCrawler()->filter('form[name=tag_edit_form]')->form();
|
||||
$client->submit($form, [
|
||||
'tag_edit_form' => ['name' => 'Test 2 updated']
|
||||
]);
|
||||
$this->assertIsRedirect($client, $this->createUrl('/admin/tags/'));
|
||||
$client->followRedirect();
|
||||
$this->assertHasDataTable($client);
|
||||
$this->request($client, '/admin/tags/1/edit');
|
||||
$editForm = $client->getCrawler()->filter('form[name=tag_edit_form]')->form();
|
||||
$this->assertEquals('Test 2 updated', $editForm->get('tag_edit_form[name]')->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user