diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 4eb67ffd..7b32354f 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | |||
@@ -505,7 +505,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
505 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 505 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); |
506 | $this->assertContains('Tagging rules updated', $alert[0]); | 506 | $this->assertContains('Tagging rules updated', $alert[0]); |
507 | 507 | ||
508 | $deleteLink = $crawler->filter('.delete')->eq(0)->link(); | 508 | $deleteLink = $crawler->filter('.delete')->last()->link(); |
509 | 509 | ||
510 | $crawler = $client->click($deleteLink); | 510 | $crawler = $client->click($deleteLink); |
511 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 511 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index 56b4c9e4..9f2bcd6c 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php | |||
@@ -102,6 +102,41 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
102 | $this->assertContains('Google', $alert[0]); | 102 | $this->assertContains('Google', $alert[0]); |
103 | } | 103 | } |
104 | 104 | ||
105 | /** | ||
106 | * This test will require an internet connection. | ||
107 | */ | ||
108 | public function testPostNewThatWillBeTaggued() | ||
109 | { | ||
110 | $this->logInAs('admin'); | ||
111 | $client = $this->getClient(); | ||
112 | |||
113 | $crawler = $client->request('GET', '/new'); | ||
114 | |||
115 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
116 | |||
117 | $form = $crawler->filter('button[type=submit]')->form(); | ||
118 | |||
119 | $data = array( | ||
120 | 'entry[url]' => $url = 'https://github.com/wallabag/wallabag', | ||
121 | ); | ||
122 | |||
123 | $client->submit($form, $data); | ||
124 | |||
125 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | ||
126 | |||
127 | $crawler = $client->followRedirect(); | ||
128 | |||
129 | $em = $client->getContainer() | ||
130 | ->get('doctrine.orm.entity_manager'); | ||
131 | $entry = $em | ||
132 | ->getRepository('WallabagCoreBundle:Entry') | ||
133 | ->findOneByUrl($url); | ||
134 | $this->assertCount(1, $entry->getTags()); | ||
135 | |||
136 | $em->remove($entry); | ||
137 | $em->flush(); | ||
138 | } | ||
139 | |||
105 | public function testArchive() | 140 | public function testArchive() |
106 | { | 141 | { |
107 | $this->logInAs('admin'); | 142 | $this->logInAs('admin'); |