mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-17 17:08:37 +00:00
Add a quick test
This commit is contained in:
parent
aeff8aa765
commit
958671a7ae
3 changed files with 44 additions and 1 deletions
|
@ -102,6 +102,41 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertContains('Google', $alert[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* This test will require an internet connection.
|
||||
*/
|
||||
public function testPostNewThatWillBeTaggued()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$crawler = $client->request('GET', '/new');
|
||||
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$form = $crawler->filter('button[type=submit]')->form();
|
||||
|
||||
$data = array(
|
||||
'entry[url]' => $url = 'https://github.com/wallabag/wallabag',
|
||||
);
|
||||
|
||||
$client->submit($form, $data);
|
||||
|
||||
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->followRedirect();
|
||||
|
||||
$em = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager');
|
||||
$entry = $em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneByUrl($url);
|
||||
$this->assertCount(1, $entry->getTags());
|
||||
|
||||
$em->remove($entry);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
public function testArchive()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue