From 38520658addc217f127b0627ea28dcf8d6e6178c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 3 Jul 2017 07:30:54 +0200 Subject: Fix tests --- tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 9 +++++---- tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/Wallabag/CoreBundle/Controller') 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 $client = $this->getClient(); $client->request('GET', '/unread/list'); + $this->assertSame(302, $client->getResponse()->getStatusCode()); $crawler = $client->followRedirect(); $this->assertSame(200, $client->getResponse()->getStatusCode()); @@ -505,7 +506,7 @@ class EntryControllerTest extends WallabagCoreTestCase ->getRepository('WallabagCoreBundle:Entry') ->find($entry->getId()); - $this->assertSame($res->isArchived(), true); + $this->assertSame(1, $res->isArchived()); } public function testToggleStar() @@ -528,7 +529,7 @@ class EntryControllerTest extends WallabagCoreTestCase ->getRepository('WallabagCoreBundle:Entry') ->findOneById($entry->getId()); - $this->assertSame($res->isStarred(), true); + $this->assertSame(1, $res->isStarred()); } public function testDelete() @@ -1004,7 +1005,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame($url, $entry->getUrl()); $this->assertContains('Perpignan', $entry->getTitle()); // instead of checking for the filename (which might change) check that the image is now local - $this->assertContains('https://your-wallabag-url-instance.com/assets/images/', $entry->getContent()); + $this->assertContains($client->getContainer()->getParameter('domain_name') . '/assets/images/', $entry->getContent()); $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); } @@ -1296,7 +1297,7 @@ class EntryControllerTest extends WallabagCoreTestCase ], 'fucked_list_of_languages' => [ 'http://geocatalog.webservice-energy.org/geonetwork/srv/eng/main.home', - '', + null, ], 'es-ES' => [ '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 $this->assertArrayHasKey('created_at', $content[0]); $this->assertArrayHasKey('updated_at', $content[0]); - $this->assertSame($contentInDB->isArchived(), $content[0]['is_archived']); - $this->assertSame($contentInDB->isStarred(), $content[0]['is_starred']); + $this->assertSame((int) $contentInDB->isArchived(), $content[0]['is_archived']); + $this->assertSame((int) $contentInDB->isStarred(), $content[0]['is_starred']); $this->assertSame($contentInDB->getTitle(), $content[0]['title']); $this->assertSame($contentInDB->getUrl(), $content[0]['url']); $this->assertSame([['text' => 'This is my annotation /o/', 'quote' => 'content']], $content[0]['annotations']); -- cgit v1.2.3