aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php9
-rw-r--r--tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php4
-rw-r--r--tests/Wallabag/CoreBundle/Event/Listener/UserLocaleListenerTest.php2
-rw-r--r--tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php24
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php2
5 files changed, 18 insertions, 23 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']);
diff --git a/tests/Wallabag/CoreBundle/Event/Listener/UserLocaleListenerTest.php b/tests/Wallabag/CoreBundle/Event/Listener/UserLocaleListenerTest.php
index 91ce0102..5ffe1ca6 100644
--- a/tests/Wallabag/CoreBundle/Event/Listener/UserLocaleListenerTest.php
+++ b/tests/Wallabag/CoreBundle/Event/Listener/UserLocaleListenerTest.php
@@ -53,6 +53,6 @@ class UserLocaleListenerTest extends \PHPUnit_Framework_TestCase
53 53
54 $listener->onInteractiveLogin($event); 54 $listener->onInteractiveLogin($event);
55 55
56 $this->assertSame('', $session->get('_locale')); 56 $this->assertNull($session->get('_locale'));
57 } 57 }
58} 58}
diff --git a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
index 85036e35..5d6a29fe 100644
--- a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
+++ b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
@@ -2,7 +2,6 @@
2 2
3namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator; 3namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator;
4 4
5use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig;
6use Graby\SiteConfig\SiteConfig as GrabySiteConfig; 5use Graby\SiteConfig\SiteConfig as GrabySiteConfig;
7use Monolog\Handler\TestHandler; 6use Monolog\Handler\TestHandler;
8use Monolog\Logger; 7use Monolog\Logger;
@@ -68,20 +67,15 @@ class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase
68 67
69 $config = $this->builder->buildForHost('www.example.com'); 68 $config = $this->builder->buildForHost('www.example.com');
70 69
71 $this->assertSame( 70 $this->assertSame('example.com', $config->getHost());
72 new SiteConfig([ 71 $this->assertSame(true, $config->requiresLogin());
73 'host' => 'example.com', 72 $this->assertSame('http://www.example.com/login', $config->getLoginUri());
74 'requiresLogin' => true, 73 $this->assertSame('login', $config->getUsernameField());
75 'loginUri' => 'http://www.example.com/login', 74 $this->assertSame('password', $config->getPasswordField());
76 'usernameField' => 'login', 75 $this->assertSame(['field' => 'value'], $config->getExtraFields());
77 'passwordField' => 'password', 76 $this->assertSame('//div[@class="need-login"]', $config->getNotLoggedInXpath());
78 'extraFields' => ['field' => 'value'], 77 $this->assertSame('foo', $config->getUsername());
79 'notLoggedInXpath' => '//div[@class="need-login"]', 78 $this->assertSame('bar', $config->getPassword());
80 'username' => 'foo',
81 'password' => 'bar',
82 ]),
83 $config
84 );
85 79
86 $records = $handler->getRecords(); 80 $records = $handler->getRecords();
87 81
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index 7e19631b..c63671c4 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -51,7 +51,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
51 $this->assertEmpty($entry->getMimetype()); 51 $this->assertEmpty($entry->getMimetype());
52 $this->assertEmpty($entry->getLanguage()); 52 $this->assertEmpty($entry->getLanguage());
53 $this->assertSame(0.0, $entry->getReadingTime()); 53 $this->assertSame(0.0, $entry->getReadingTime());
54 $this->assertSame(false, $entry->getDomainName()); 54 $this->assertSame(null, $entry->getDomainName());
55 } 55 }
56 56
57 public function testWithEmptyContent() 57 public function testWithEmptyContent()