diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Tests')
6 files changed, 14 insertions, 13 deletions
diff --git a/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php index c2acd68c..174641fd 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/PocketControllerTest.php | |||
@@ -37,6 +37,6 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
37 | 37 | ||
38 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 38 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
39 | $this->assertContains('import/pocket', $client->getResponse()->headers->get('location')); | 39 | $this->assertContains('import/pocket', $client->getResponse()->headers->get('location')); |
40 | $this->assertEquals('Import failed, please try again.', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); | 40 | $this->assertEquals('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php index 7f97b0f5..8d353a71 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php | |||
@@ -54,8 +54,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
54 | 54 | ||
55 | $this->assertTrue($content->getTags()->contains($tag)); | 55 | $this->assertTrue($content->getTags()->contains($tag)); |
56 | 56 | ||
57 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 57 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); |
58 | $this->assertContains('Import summary', $alert[0]); | 58 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
59 | } | 59 | } |
60 | 60 | ||
61 | public function testImportWallabagWithFileAndMarkAllAsRead() | 61 | public function testImportWallabagWithFileAndMarkAllAsRead() |
@@ -99,7 +99,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
99 | 99 | ||
100 | $this->assertTrue($content2->isArchived()); | 100 | $this->assertTrue($content2->isArchived()); |
101 | 101 | ||
102 | $this->assertContains('Import summary', $client->getResponse()->getContent()); | 102 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); |
103 | $this->assertContains('flashes.import.notice.summary', $body[0]); | ||
103 | } | 104 | } |
104 | 105 | ||
105 | public function testImportWallabagWithEmptyFile() | 106 | public function testImportWallabagWithEmptyFile() |
@@ -122,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
122 | 123 | ||
123 | $crawler = $client->followRedirect(); | 124 | $crawler = $client->followRedirect(); |
124 | 125 | ||
125 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 126 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); |
126 | $this->assertContains('Import failed, please try again', $alert[0]); | 127 | $this->assertContains('flashes.import.notice.failed', $body[0]); |
127 | } | 128 | } |
128 | } | 129 | } |
diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php index 617c0517..bcbd6305 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php | |||
@@ -39,8 +39,8 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
39 | 39 | ||
40 | $crawler = $client->followRedirect(); | 40 | $crawler = $client->followRedirect(); |
41 | 41 | ||
42 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 42 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); |
43 | $this->assertContains('Import summary', $alert[0]); | 43 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
44 | 44 | ||
45 | $content = $client->getContainer() | 45 | $content = $client->getContainer() |
46 | ->get('doctrine.orm.entity_manager') | 46 | ->get('doctrine.orm.entity_manager') |
@@ -87,7 +87,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
87 | 87 | ||
88 | $crawler = $client->followRedirect(); | 88 | $crawler = $client->followRedirect(); |
89 | 89 | ||
90 | $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); | 90 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); |
91 | $this->assertContains('Import failed, please try again', $alert[0]); | 91 | $this->assertContains('flashes.import.notice.failed', $body[0]); |
92 | } | 92 | } |
93 | } | 93 | } |
diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php index 450cdc95..43b60ec3 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php | |||
@@ -85,7 +85,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase | |||
85 | 85 | ||
86 | $this->assertEquals('Pocket', $pocketImport->getName()); | 86 | $this->assertEquals('Pocket', $pocketImport->getName()); |
87 | $this->assertNotEmpty($pocketImport->getUrl()); | 87 | $this->assertNotEmpty($pocketImport->getUrl()); |
88 | $this->assertContains('This importer will import all your Pocket data.', $pocketImport->getDescription()); | 88 | $this->assertEquals('import.pocket.description', $pocketImport->getDescription()); |
89 | } | 89 | } |
90 | 90 | ||
91 | public function testOAuthRequest() | 91 | public function testOAuthRequest() |
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php index 8ab7e830..496cf2d3 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php | |||
@@ -45,7 +45,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase | |||
45 | 45 | ||
46 | $this->assertEquals('wallabag v1', $wallabagV1Import->getName()); | 46 | $this->assertEquals('wallabag v1', $wallabagV1Import->getName()); |
47 | $this->assertNotEmpty($wallabagV1Import->getUrl()); | 47 | $this->assertNotEmpty($wallabagV1Import->getUrl()); |
48 | $this->assertContains('This importer will import all your wallabag v1 articles.', $wallabagV1Import->getDescription()); | 48 | $this->assertEquals('import.wallabag_v1.description', $wallabagV1Import->getDescription()); |
49 | } | 49 | } |
50 | 50 | ||
51 | public function testImport() | 51 | public function testImport() |
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php index 2b642d27..341b1076 100644 --- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php +++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php | |||
@@ -45,7 +45,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase | |||
45 | 45 | ||
46 | $this->assertEquals('wallabag v2', $wallabagV2Import->getName()); | 46 | $this->assertEquals('wallabag v2', $wallabagV2Import->getName()); |
47 | $this->assertNotEmpty($wallabagV2Import->getUrl()); | 47 | $this->assertNotEmpty($wallabagV2Import->getUrl()); |
48 | $this->assertContains('This importer will import all your wallabag v2 articles.', $wallabagV2Import->getDescription()); | 48 | $this->assertEquals('import.wallabag_v2.description', $wallabagV2Import->getDescription()); |
49 | } | 49 | } |
50 | 50 | ||
51 | public function testImport() | 51 | public function testImport() |