]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php
Convert array + phpDoc
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Tests / Controller / WallabagV1ControllerTest.php
index 6c876b3b419eeea6a2e7e2da60b815af4905aac0..f7de3fef61a43dce3fdc07aebcbc56f3cc38d556 100644 (file)
@@ -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, $body = $crawler->filter('body')->extract(array('_text')));
-        $this->assertContains('Import summary', $body[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,8 +99,8 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
 
         $this->assertTrue($content2->isArchived());
 
-        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
-        $this->assertContains('Import summary', $body[0]);
+        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
+        $this->assertContains('flashes.import.notice.summary', $body[0]);
     }
 
     public function testImportWallabagWithEmptyFile()
@@ -113,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);
 
@@ -123,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
 
         $crawler = $client->followRedirect();
 
-        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
-        $this->assertContains('Import failed, please try again', $body[0]);
+        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
+        $this->assertContains('flashes.import.notice.failed', $body[0]);
     }
 }