diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-03 07:30:54 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-03 07:30:54 +0200 |
commit | 38520658addc217f127b0627ea28dcf8d6e6178c (patch) | |
tree | 71795eadcf13fda9198b8cd9a3da26d51826bbd9 /tests/Wallabag/CoreBundle/Controller | |
parent | f808b01692a835673f328d7221ba8c212caa9b61 (diff) | |
download | wallabag-38520658addc217f127b0627ea28dcf8d6e6178c.tar.gz wallabag-38520658addc217f127b0627ea28dcf8d6e6178c.tar.zst wallabag-38520658addc217f127b0627ea28dcf8d6e6178c.zip |
Fix tests
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 9 | ||||
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index b528bcdb..b1c6d53c 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -43,6 +43,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
43 | $client = $this->getClient(); | 43 | $client = $this->getClient(); |
44 | 44 | ||
45 | $client->request('GET', '/unread/list'); | 45 | $client->request('GET', '/unread/list'); |
46 | $this->assertSame(302, $client->getResponse()->getStatusCode()); | ||
46 | $crawler = $client->followRedirect(); | 47 | $crawler = $client->followRedirect(); |
47 | 48 | ||
48 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | 49 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
@@ -505,7 +506,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
505 | ->getRepository('WallabagCoreBundle:Entry') | 506 | ->getRepository('WallabagCoreBundle:Entry') |
506 | ->find($entry->getId()); | 507 | ->find($entry->getId()); |
507 | 508 | ||
508 | $this->assertSame($res->isArchived(), true); | 509 | $this->assertSame(1, $res->isArchived()); |
509 | } | 510 | } |
510 | 511 | ||
511 | public function testToggleStar() | 512 | public function testToggleStar() |
@@ -528,7 +529,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
528 | ->getRepository('WallabagCoreBundle:Entry') | 529 | ->getRepository('WallabagCoreBundle:Entry') |
529 | ->findOneById($entry->getId()); | 530 | ->findOneById($entry->getId()); |
530 | 531 | ||
531 | $this->assertSame($res->isStarred(), true); | 532 | $this->assertSame(1, $res->isStarred()); |
532 | } | 533 | } |
533 | 534 | ||
534 | public function testDelete() | 535 | public function testDelete() |
@@ -1004,7 +1005,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1004 | $this->assertSame($url, $entry->getUrl()); | 1005 | $this->assertSame($url, $entry->getUrl()); |
1005 | $this->assertContains('Perpignan', $entry->getTitle()); | 1006 | $this->assertContains('Perpignan', $entry->getTitle()); |
1006 | // instead of checking for the filename (which might change) check that the image is now local | 1007 | // instead of checking for the filename (which might change) check that the image is now local |
1007 | $this->assertContains('https://your-wallabag-url-instance.com/assets/images/', $entry->getContent()); | 1008 | $this->assertContains($client->getContainer()->getParameter('domain_name') . '/assets/images/', $entry->getContent()); |
1008 | 1009 | ||
1009 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); | 1010 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); |
1010 | } | 1011 | } |
@@ -1296,7 +1297,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1296 | ], | 1297 | ], |
1297 | 'fucked_list_of_languages' => [ | 1298 | 'fucked_list_of_languages' => [ |
1298 | 'http://geocatalog.webservice-energy.org/geonetwork/srv/eng/main.home', | 1299 | 'http://geocatalog.webservice-energy.org/geonetwork/srv/eng/main.home', |
1299 | '', | 1300 | null, |
1300 | ], | 1301 | ], |
1301 | 'es-ES' => [ | 1302 | 'es-ES' => [ |
1302 | 'http://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google', | 1303 | 'http://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google', |
diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php index ba9296af..3e216381 100644 --- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php | |||
@@ -230,8 +230,8 @@ class ExportControllerTest extends WallabagCoreTestCase | |||
230 | $this->assertArrayHasKey('created_at', $content[0]); | 230 | $this->assertArrayHasKey('created_at', $content[0]); |
231 | $this->assertArrayHasKey('updated_at', $content[0]); | 231 | $this->assertArrayHasKey('updated_at', $content[0]); |
232 | 232 | ||
233 | $this->assertSame($contentInDB->isArchived(), $content[0]['is_archived']); | 233 | $this->assertSame((int) $contentInDB->isArchived(), $content[0]['is_archived']); |
234 | $this->assertSame($contentInDB->isStarred(), $content[0]['is_starred']); | 234 | $this->assertSame((int) $contentInDB->isStarred(), $content[0]['is_starred']); |
235 | $this->assertSame($contentInDB->getTitle(), $content[0]['title']); | 235 | $this->assertSame($contentInDB->getTitle(), $content[0]['title']); |
236 | $this->assertSame($contentInDB->getUrl(), $content[0]['url']); | 236 | $this->assertSame($contentInDB->getUrl(), $content[0]['url']); |
237 | $this->assertSame([['text' => 'This is my annotation /o/', 'quote' => 'content']], $content[0]['annotations']); | 237 | $this->assertSame([['text' => 'This is my annotation /o/', 'quote' => 'content']], $content[0]['annotations']); |