diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
4 files changed, 17 insertions, 25 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php index 7a819953..24910e60 100644 --- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php +++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php | |||
@@ -41,7 +41,7 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
41 | ->getMock(); | 41 | ->getMock(); |
42 | $dialog->expects($this->any()) | 42 | $dialog->expects($this->any()) |
43 | ->method('ask') | 43 | ->method('ask') |
44 | ->will($this->returnValue('test')); | 44 | ->will($this->returnValue('test_'.uniqid('', true))); |
45 | $dialog->expects($this->any()) | 45 | $dialog->expects($this->any()) |
46 | ->method('askConfirmation') | 46 | ->method('askConfirmation') |
47 | ->will($this->returnValue(true)); | 47 | ->will($this->returnValue(true)); |
@@ -75,7 +75,7 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
75 | ->getMock(); | 75 | ->getMock(); |
76 | $dialog->expects($this->any()) | 76 | $dialog->expects($this->any()) |
77 | ->method('ask') | 77 | ->method('ask') |
78 | ->will($this->returnValue('test')); | 78 | ->will($this->returnValue('test_'.uniqid('', true))); |
79 | $dialog->expects($this->any()) | 79 | $dialog->expects($this->any()) |
80 | ->method('askConfirmation') | 80 | ->method('askConfirmation') |
81 | ->will($this->returnValue(true)); | 81 | ->will($this->returnValue(true)); |
@@ -125,7 +125,7 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
125 | ->getMock(); | 125 | ->getMock(); |
126 | $dialog->expects($this->any()) | 126 | $dialog->expects($this->any()) |
127 | ->method('ask') | 127 | ->method('ask') |
128 | ->will($this->returnValue('test')); | 128 | ->will($this->returnValue('test_'.uniqid('', true))); |
129 | $dialog->expects($this->any()) | 129 | $dialog->expects($this->any()) |
130 | ->method('askConfirmation') | 130 | ->method('askConfirmation') |
131 | ->will($this->returnValue(true)); | 131 | ->will($this->returnValue(true)); |
@@ -259,7 +259,7 @@ class InstallCommandTest extends WallabagCoreTestCase | |||
259 | ->getMock(); | 259 | ->getMock(); |
260 | $dialog->expects($this->any()) | 260 | $dialog->expects($this->any()) |
261 | ->method('ask') | 261 | ->method('ask') |
262 | ->will($this->returnValue('test')); | 262 | ->will($this->returnValue('test_'.uniqid('', true))); |
263 | $dialog->expects($this->any()) | 263 | $dialog->expects($this->any()) |
264 | ->method('askConfirmation') | 264 | ->method('askConfirmation') |
265 | ->will($this->returnValue(true)); | 265 | ->will($this->returnValue(true)); |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php index 5ab9c329..116eec60 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php | |||
@@ -192,14 +192,14 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
192 | 'update_user[name]' => '', | 192 | 'update_user[name]' => '', |
193 | 'update_user[email]' => '', | 193 | 'update_user[email]' => '', |
194 | ), | 194 | ), |
195 | 'This value should not be blank.', | 195 | 'Please enter an email', |
196 | ), | 196 | ), |
197 | array( | 197 | array( |
198 | array( | 198 | array( |
199 | 'update_user[name]' => '', | 199 | 'update_user[name]' => '', |
200 | 'update_user[email]' => 'test', | 200 | 'update_user[email]' => 'test', |
201 | ), | 201 | ), |
202 | 'This value is not a valid email address.', | 202 | 'The email is not valid', |
203 | ), | 203 | ), |
204 | ); | 204 | ); |
205 | } | 205 | } |
@@ -261,31 +261,23 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
261 | 'new_user[password]' => '', | 261 | 'new_user[password]' => '', |
262 | 'new_user[email]' => '', | 262 | 'new_user[email]' => '', |
263 | ), | 263 | ), |
264 | 'This value should not be blank.', | 264 | 'Please enter a username', |
265 | ), | 265 | ), |
266 | array( | 266 | array( |
267 | array( | 267 | array( |
268 | 'new_user[username]' => 'ad', | 268 | 'new_user[username]' => 'a', |
269 | 'new_user[password]' => '', | 269 | 'new_user[password]' => 'mypassword', |
270 | 'new_user[email]' => '', | 270 | 'new_user[email]' => '', |
271 | ), | 271 | ), |
272 | 'This value is too short.', | 272 | 'The username is too short', |
273 | ), | 273 | ), |
274 | array( | 274 | array( |
275 | array( | 275 | array( |
276 | 'new_user[username]' => 'wallace', | 276 | 'new_user[username]' => 'wallace', |
277 | 'new_user[password]' => '', | 277 | 'new_user[password]' => 'mypassword', |
278 | 'new_user[email]' => 'test', | 278 | 'new_user[email]' => 'test', |
279 | ), | 279 | ), |
280 | 'This value is not a valid email address.', | 280 | 'The email is not valid', |
281 | ), | ||
282 | array( | ||
283 | array( | ||
284 | 'new_user[username]' => 'wallace', | ||
285 | 'new_user[password]' => 'admin', | ||
286 | 'new_user[email]' => 'wallace@wallace.me', | ||
287 | ), | ||
288 | 'Password should by at least', | ||
289 | ), | 281 | ), |
290 | array( | 282 | array( |
291 | array( | 283 | array( |
@@ -293,7 +285,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
293 | 'new_user[password]' => 'wallacewallace', | 285 | 'new_user[password]' => 'wallacewallace', |
294 | 'new_user[email]' => 'wallace@wallace.me', | 286 | 'new_user[email]' => 'wallace@wallace.me', |
295 | ), | 287 | ), |
296 | 'This value is already used', | 288 | 'The username is already used', |
297 | ), | 289 | ), |
298 | ); | 290 | ); |
299 | } | 291 | } |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index 5798009c..77b57884 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php | |||
@@ -209,7 +209,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
209 | $content = $client->getContainer() | 209 | $content = $client->getContainer() |
210 | ->get('doctrine.orm.entity_manager') | 210 | ->get('doctrine.orm.entity_manager') |
211 | ->getRepository('WallabagCoreBundle:Entry') | 211 | ->getRepository('WallabagCoreBundle:Entry') |
212 | ->findOneById(1); | 212 | ->findOneByIsStarred(false); |
213 | 213 | ||
214 | $client->request('GET', '/delete/'.$content->getId()); | 214 | $client->request('GET', '/delete/'.$content->getId()); |
215 | 215 | ||
@@ -360,14 +360,14 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
360 | $form['entry_filter[isStarred]']->untick(); | 360 | $form['entry_filter[isStarred]']->untick(); |
361 | 361 | ||
362 | $crawler = $client->submit($form); | 362 | $crawler = $client->submit($form); |
363 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | 363 | $this->assertCount(2, $crawler->filter('div[class=entry]')); |
364 | 364 | ||
365 | $form = $crawler->filter('button[id=submit-filter]')->form(); | 365 | $form = $crawler->filter('button[id=submit-filter]')->form(); |
366 | $form['entry_filter[isArchived]']->untick(); | 366 | $form['entry_filter[isArchived]']->untick(); |
367 | $form['entry_filter[isStarred]']->tick(); | 367 | $form['entry_filter[isStarred]']->tick(); |
368 | 368 | ||
369 | $crawler = $client->submit($form); | 369 | $crawler = $client->submit($form); |
370 | $this->assertCount(1, $crawler->filter('div[class=entry]')); | 370 | $this->assertCount(2, $crawler->filter('div[class=entry]')); |
371 | } | 371 | } |
372 | 372 | ||
373 | public function testPreviewPictureFilter() | 373 | public function testPreviewPictureFilter() |
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php index af39d6ce..d25b2db5 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php | |||
@@ -24,7 +24,7 @@ class TagControllerTest extends WallabagCoreTestCase | |||
24 | $entry = $client->getContainer() | 24 | $entry = $client->getContainer() |
25 | ->get('doctrine.orm.entity_manager') | 25 | ->get('doctrine.orm.entity_manager') |
26 | ->getRepository('WallabagCoreBundle:Entry') | 26 | ->getRepository('WallabagCoreBundle:Entry') |
27 | ->findOneByIsArchived(false); | 27 | ->findOneBy(array()); |
28 | 28 | ||
29 | $crawler = $client->request('GET', '/view/'.$entry->getId()); | 29 | $crawler = $client->request('GET', '/view/'.$entry->getId()); |
30 | 30 | ||