X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FTests%2FController%2FWallabagV1ControllerTest.php;h=f7de3fef61a43dce3fdc07aebcbc56f3cc38d556;hb=4094ea47712efbe58624ff74daeb1f77c9b0edcf;hp=7f97b0f5522719505d75e323296cda498e5f6837;hpb=d89908aed331779fc79b8e50ddaa51212b6269f5;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php index 7f97b0f5..f7de3fef 100644 --- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php +++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php @@ -29,9 +29,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); - $data = array( + $data = [ 'upload_import_file[file]' => $file, - ); + ]; $client->submit($form, $data); @@ -54,8 +54,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertTrue($content->getTags()->contains($tag)); - $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); - $this->assertContains('Import summary', $alert[0]); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.summary', $body[0]); } public function testImportWallabagWithFileAndMarkAllAsRead() @@ -68,10 +68,10 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json'); - $data = array( + $data = [ 'upload_import_file[file]' => $file, 'upload_import_file[mark_as_read]' => 1, - ); + ]; $client->submit($form, $data); @@ -99,7 +99,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $this->assertTrue($content2->isArchived()); - $this->assertContains('Import summary', $client->getResponse()->getContent()); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.summary', $body[0]); } public function testImportWallabagWithEmptyFile() @@ -112,9 +113,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); - $data = array( + $data = [ 'upload_import_file[file]' => $file, - ); + ]; $client->submit($form, $data); @@ -122,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $crawler = $client->followRedirect(); - $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); - $this->assertContains('Import failed, please try again', $alert[0]); + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + $this->assertContains('flashes.import.notice.failed', $body[0]); } }