diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-07-03 13:39:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 13:39:54 +0200 |
commit | 71e1cbc8eb5928d393b0772055d6b711e90a09b3 (patch) | |
tree | 71795eadcf13fda9198b8cd9a3da26d51826bbd9 /tests/Wallabag/ImportBundle/Controller | |
parent | 822c877949aff8ae57677671115f8f4fc69588d5 (diff) | |
parent | 38520658addc217f127b0627ea28dcf8d6e6178c (diff) | |
download | wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.gz wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.zst wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.zip |
Merge pull request #3258 from wallabag/cs-fixer
Add a real configuration for CS-Fixer
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller')
9 files changed, 158 insertions, 158 deletions
diff --git a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php index 8e9f65e3..3873ccf4 100644 --- a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class ChromeControllerTest extends WallabagCoreTestCase | 8 | class ChromeControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/chrome'); | 15 | $crawler = $client->request('GET', '/import/chrome'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportChromeWithRabbitEnabled() | 22 | public function testImportChromeWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/chrome'); | 29 | $crawler = $client->request('GET', '/import/chrome'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportChromeWithRedisEnabled() | 55 | public function testImportChromeWithRedisEnabled() |
@@ -61,13 +61,13 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
61 | 61 | ||
62 | $crawler = $client->request('GET', '/import/chrome'); | 62 | $crawler = $client->request('GET', '/import/chrome'); |
63 | 63 | ||
64 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 64 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
65 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 65 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
66 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 66 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
67 | 67 | ||
68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
69 | 69 | ||
70 | $file = new UploadedFile(__DIR__.'/../fixtures/chrome-bookmarks', 'Bookmarks'); | 70 | $file = new UploadedFile(__DIR__ . '/../fixtures/chrome-bookmarks', 'Bookmarks'); |
71 | 71 | ||
72 | $data = [ | 72 | $data = [ |
73 | 'upload_import_file[file]' => $file, | 73 | 'upload_import_file[file]' => $file, |
@@ -75,7 +75,7 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
75 | 75 | ||
76 | $client->submit($form, $data); | 76 | $client->submit($form, $data); |
77 | 77 | ||
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 78 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
79 | 79 | ||
80 | $crawler = $client->followRedirect(); | 80 | $crawler = $client->followRedirect(); |
81 | 81 | ||
@@ -95,7 +95,7 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
95 | $crawler = $client->request('GET', '/import/chrome'); | 95 | $crawler = $client->request('GET', '/import/chrome'); |
96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
97 | 97 | ||
98 | $file = new UploadedFile(__DIR__.'/../fixtures/chrome-bookmarks', 'Bookmarks'); | 98 | $file = new UploadedFile(__DIR__ . '/../fixtures/chrome-bookmarks', 'Bookmarks'); |
99 | 99 | ||
100 | $data = [ | 100 | $data = [ |
101 | 'upload_import_file[file]' => $file, | 101 | 'upload_import_file[file]' => $file, |
@@ -103,7 +103,7 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
103 | 103 | ||
104 | $client->submit($form, $data); | 104 | $client->submit($form, $data); |
105 | 105 | ||
106 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 106 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
107 | 107 | ||
108 | $crawler = $client->followRedirect(); | 108 | $crawler = $client->followRedirect(); |
109 | 109 | ||
@@ -120,11 +120,11 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
120 | 120 | ||
121 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok'); | 121 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok'); |
122 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok'); | 122 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok'); |
123 | $this->assertEquals(1, count($content->getTags())); | 123 | $this->assertSame(1, count($content->getTags())); |
124 | 124 | ||
125 | $createdAt = $content->getCreatedAt(); | 125 | $createdAt = $content->getCreatedAt(); |
126 | $this->assertEquals('2011', $createdAt->format('Y')); | 126 | $this->assertSame('2011', $createdAt->format('Y')); |
127 | $this->assertEquals('07', $createdAt->format('m')); | 127 | $this->assertSame('07', $createdAt->format('m')); |
128 | } | 128 | } |
129 | 129 | ||
130 | public function testImportWallabagWithEmptyFile() | 130 | public function testImportWallabagWithEmptyFile() |
@@ -135,7 +135,7 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
135 | $crawler = $client->request('GET', '/import/chrome'); | 135 | $crawler = $client->request('GET', '/import/chrome'); |
136 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 136 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
137 | 137 | ||
138 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 138 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
139 | 139 | ||
140 | $data = [ | 140 | $data = [ |
141 | 'upload_import_file[file]' => $file, | 141 | 'upload_import_file[file]' => $file, |
@@ -143,7 +143,7 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
143 | 143 | ||
144 | $client->submit($form, $data); | 144 | $client->submit($form, $data); |
145 | 145 | ||
146 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 146 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
147 | 147 | ||
148 | $crawler = $client->followRedirect(); | 148 | $crawler = $client->followRedirect(); |
149 | 149 | ||
diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php index 5354439c..5e1260b1 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class FirefoxControllerTest extends WallabagCoreTestCase | 8 | class FirefoxControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/firefox'); | 15 | $crawler = $client->request('GET', '/import/firefox'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportFirefoxWithRabbitEnabled() | 22 | public function testImportFirefoxWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/firefox'); | 29 | $crawler = $client->request('GET', '/import/firefox'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportFirefoxWithRedisEnabled() | 55 | public function testImportFirefoxWithRedisEnabled() |
@@ -61,13 +61,13 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
61 | 61 | ||
62 | $crawler = $client->request('GET', '/import/firefox'); | 62 | $crawler = $client->request('GET', '/import/firefox'); |
63 | 63 | ||
64 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 64 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
65 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 65 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
66 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 66 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
67 | 67 | ||
68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
69 | 69 | ||
70 | $file = new UploadedFile(__DIR__.'/../fixtures/firefox-bookmarks.json', 'Bookmarks'); | 70 | $file = new UploadedFile(__DIR__ . '/../fixtures/firefox-bookmarks.json', 'Bookmarks'); |
71 | 71 | ||
72 | $data = [ | 72 | $data = [ |
73 | 'upload_import_file[file]' => $file, | 73 | 'upload_import_file[file]' => $file, |
@@ -75,7 +75,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
75 | 75 | ||
76 | $client->submit($form, $data); | 76 | $client->submit($form, $data); |
77 | 77 | ||
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 78 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
79 | 79 | ||
80 | $crawler = $client->followRedirect(); | 80 | $crawler = $client->followRedirect(); |
81 | 81 | ||
@@ -95,7 +95,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
95 | $crawler = $client->request('GET', '/import/firefox'); | 95 | $crawler = $client->request('GET', '/import/firefox'); |
96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
97 | 97 | ||
98 | $file = new UploadedFile(__DIR__.'/../fixtures/firefox-bookmarks.json', 'Bookmarks'); | 98 | $file = new UploadedFile(__DIR__ . '/../fixtures/firefox-bookmarks.json', 'Bookmarks'); |
99 | 99 | ||
100 | $data = [ | 100 | $data = [ |
101 | 'upload_import_file[file]' => $file, | 101 | 'upload_import_file[file]' => $file, |
@@ -103,7 +103,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
103 | 103 | ||
104 | $client->submit($form, $data); | 104 | $client->submit($form, $data); |
105 | 105 | ||
106 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 106 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
107 | 107 | ||
108 | $crawler = $client->followRedirect(); | 108 | $crawler = $client->followRedirect(); |
109 | 109 | ||
@@ -121,7 +121,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok'); | 121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok'); |
122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok'); | 122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok'); |
123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok'); | 123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok'); |
124 | $this->assertEquals(3, count($content->getTags())); | 124 | $this->assertSame(3, count($content->getTags())); |
125 | 125 | ||
126 | $content = $client->getContainer() | 126 | $content = $client->getContainer() |
127 | ->get('doctrine.orm.entity_manager') | 127 | ->get('doctrine.orm.entity_manager') |
@@ -136,8 +136,8 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
136 | $this->assertEmpty($content->getLanguage(), 'Language for https://stackoverflow.com is ok'); | 136 | $this->assertEmpty($content->getLanguage(), 'Language for https://stackoverflow.com is ok'); |
137 | 137 | ||
138 | $createdAt = $content->getCreatedAt(); | 138 | $createdAt = $content->getCreatedAt(); |
139 | $this->assertEquals('2013', $createdAt->format('Y')); | 139 | $this->assertSame('2013', $createdAt->format('Y')); |
140 | $this->assertEquals('12', $createdAt->format('m')); | 140 | $this->assertSame('12', $createdAt->format('m')); |
141 | } | 141 | } |
142 | 142 | ||
143 | public function testImportWallabagWithEmptyFile() | 143 | public function testImportWallabagWithEmptyFile() |
@@ -148,7 +148,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
148 | $crawler = $client->request('GET', '/import/firefox'); | 148 | $crawler = $client->request('GET', '/import/firefox'); |
149 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 149 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
150 | 150 | ||
151 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 151 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
152 | 152 | ||
153 | $data = [ | 153 | $data = [ |
154 | 'upload_import_file[file]' => $file, | 154 | 'upload_import_file[file]' => $file, |
@@ -156,7 +156,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
156 | 156 | ||
157 | $client->submit($form, $data); | 157 | $client->submit($form, $data); |
158 | 158 | ||
159 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 159 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
160 | 160 | ||
161 | $crawler = $client->followRedirect(); | 161 | $crawler = $client->followRedirect(); |
162 | 162 | ||
diff --git a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php index 5e57dcef..e1ec7c65 100644 --- a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php | |||
@@ -12,7 +12,7 @@ class ImportControllerTest extends WallabagCoreTestCase | |||
12 | 12 | ||
13 | $client->request('GET', '/import/'); | 13 | $client->request('GET', '/import/'); |
14 | 14 | ||
15 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 15 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
16 | $this->assertContains('login', $client->getResponse()->headers->get('location')); | 16 | $this->assertContains('login', $client->getResponse()->headers->get('location')); |
17 | } | 17 | } |
18 | 18 | ||
@@ -23,7 +23,7 @@ class ImportControllerTest extends WallabagCoreTestCase | |||
23 | 23 | ||
24 | $crawler = $client->request('GET', '/import/'); | 24 | $crawler = $client->request('GET', '/import/'); |
25 | 25 | ||
26 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 26 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
27 | $this->assertEquals(8, $crawler->filter('blockquote')->count()); | 27 | $this->assertSame(8, $crawler->filter('blockquote')->count()); |
28 | } | 28 | } |
29 | } | 29 | } |
diff --git a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php index 84742e0a..067cf3dc 100644 --- a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class InstapaperControllerTest extends WallabagCoreTestCase | 8 | class InstapaperControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/instapaper'); | 15 | $crawler = $client->request('GET', '/import/instapaper'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportInstapaperWithRabbitEnabled() | 22 | public function testImportInstapaperWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/instapaper'); | 29 | $crawler = $client->request('GET', '/import/instapaper'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportInstapaperWithRedisEnabled() | 55 | public function testImportInstapaperWithRedisEnabled() |
@@ -61,13 +61,13 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
61 | 61 | ||
62 | $crawler = $client->request('GET', '/import/instapaper'); | 62 | $crawler = $client->request('GET', '/import/instapaper'); |
63 | 63 | ||
64 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 64 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
65 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 65 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
66 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 66 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
67 | 67 | ||
68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
69 | 69 | ||
70 | $file = new UploadedFile(__DIR__.'/../fixtures/instapaper-export.csv', 'instapaper.csv'); | 70 | $file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper.csv'); |
71 | 71 | ||
72 | $data = [ | 72 | $data = [ |
73 | 'upload_import_file[file]' => $file, | 73 | 'upload_import_file[file]' => $file, |
@@ -75,7 +75,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
75 | 75 | ||
76 | $client->submit($form, $data); | 76 | $client->submit($form, $data); |
77 | 77 | ||
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 78 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
79 | 79 | ||
80 | $crawler = $client->followRedirect(); | 80 | $crawler = $client->followRedirect(); |
81 | 81 | ||
@@ -95,7 +95,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
95 | $crawler = $client->request('GET', '/import/instapaper'); | 95 | $crawler = $client->request('GET', '/import/instapaper'); |
96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
97 | 97 | ||
98 | $file = new UploadedFile(__DIR__.'/../fixtures/instapaper-export.csv', 'instapaper.csv'); | 98 | $file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper.csv'); |
99 | 99 | ||
100 | $data = [ | 100 | $data = [ |
101 | 'upload_import_file[file]' => $file, | 101 | 'upload_import_file[file]' => $file, |
@@ -103,7 +103,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
103 | 103 | ||
104 | $client->submit($form, $data); | 104 | $client->submit($form, $data); |
105 | 105 | ||
106 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 106 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
107 | 107 | ||
108 | $crawler = $client->followRedirect(); | 108 | $crawler = $client->followRedirect(); |
109 | 109 | ||
@@ -122,7 +122,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); | 122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); |
123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); | 123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); |
124 | $this->assertContains('foot', $content->getTags(), 'It includes the "foot" tag'); | 124 | $this->assertContains('foot', $content->getTags(), 'It includes the "foot" tag'); |
125 | $this->assertEquals(1, count($content->getTags())); | 125 | $this->assertSame(1, count($content->getTags())); |
126 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 126 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
127 | 127 | ||
128 | $content = $client->getContainer() | 128 | $content = $client->getContainer() |
@@ -136,7 +136,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
136 | $this->assertContains('foot', $content->getTags()); | 136 | $this->assertContains('foot', $content->getTags()); |
137 | $this->assertContains('test_tag', $content->getTags()); | 137 | $this->assertContains('test_tag', $content->getTags()); |
138 | 138 | ||
139 | $this->assertEquals(2, count($content->getTags())); | 139 | $this->assertSame(2, count($content->getTags())); |
140 | } | 140 | } |
141 | 141 | ||
142 | public function testImportInstapaperWithFileAndMarkAllAsRead() | 142 | public function testImportInstapaperWithFileAndMarkAllAsRead() |
@@ -147,7 +147,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
147 | $crawler = $client->request('GET', '/import/instapaper'); | 147 | $crawler = $client->request('GET', '/import/instapaper'); |
148 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 148 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
149 | 149 | ||
150 | $file = new UploadedFile(__DIR__.'/../fixtures/instapaper-export.csv', 'instapaper-read.csv'); | 150 | $file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper-read.csv'); |
151 | 151 | ||
152 | $data = [ | 152 | $data = [ |
153 | 'upload_import_file[file]' => $file, | 153 | 'upload_import_file[file]' => $file, |
@@ -156,7 +156,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
156 | 156 | ||
157 | $client->submit($form, $data); | 157 | $client->submit($form, $data); |
158 | 158 | ||
159 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 159 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
160 | 160 | ||
161 | $crawler = $client->followRedirect(); | 161 | $crawler = $client->followRedirect(); |
162 | 162 | ||
@@ -192,7 +192,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
192 | $crawler = $client->request('GET', '/import/instapaper'); | 192 | $crawler = $client->request('GET', '/import/instapaper'); |
193 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 193 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
194 | 194 | ||
195 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 195 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
196 | 196 | ||
197 | $data = [ | 197 | $data = [ |
198 | 'upload_import_file[file]' => $file, | 198 | 'upload_import_file[file]' => $file, |
@@ -200,7 +200,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase | |||
200 | 200 | ||
201 | $client->submit($form, $data); | 201 | $client->submit($form, $data); |
202 | 202 | ||
203 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 203 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
204 | 204 | ||
205 | $crawler = $client->followRedirect(); | 205 | $crawler = $client->followRedirect(); |
206 | 206 | ||
diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php index e2b6e7b6..c307f96c 100644 --- a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class PinboardControllerTest extends WallabagCoreTestCase | 8 | class PinboardControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/pinboard'); | 15 | $crawler = $client->request('GET', '/import/pinboard'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportPinboardWithRabbitEnabled() | 22 | public function testImportPinboardWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/pinboard'); | 29 | $crawler = $client->request('GET', '/import/pinboard'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportPinboardWithRedisEnabled() | 55 | public function testImportPinboardWithRedisEnabled() |
@@ -61,13 +61,13 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
61 | 61 | ||
62 | $crawler = $client->request('GET', '/import/pinboard'); | 62 | $crawler = $client->request('GET', '/import/pinboard'); |
63 | 63 | ||
64 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 64 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
65 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 65 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
66 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 66 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
67 | 67 | ||
68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
69 | 69 | ||
70 | $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard.json'); | 70 | $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard.json'); |
71 | 71 | ||
72 | $data = [ | 72 | $data = [ |
73 | 'upload_import_file[file]' => $file, | 73 | 'upload_import_file[file]' => $file, |
@@ -75,7 +75,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
75 | 75 | ||
76 | $client->submit($form, $data); | 76 | $client->submit($form, $data); |
77 | 77 | ||
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 78 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
79 | 79 | ||
80 | $crawler = $client->followRedirect(); | 80 | $crawler = $client->followRedirect(); |
81 | 81 | ||
@@ -95,7 +95,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
95 | $crawler = $client->request('GET', '/import/pinboard'); | 95 | $crawler = $client->request('GET', '/import/pinboard'); |
96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
97 | 97 | ||
98 | $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard.json'); | 98 | $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard.json'); |
99 | 99 | ||
100 | $data = [ | 100 | $data = [ |
101 | 'upload_import_file[file]' => $file, | 101 | 'upload_import_file[file]' => $file, |
@@ -103,7 +103,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
103 | 103 | ||
104 | $client->submit($form, $data); | 104 | $client->submit($form, $data); |
105 | 105 | ||
106 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 106 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
107 | 107 | ||
108 | $crawler = $client->followRedirect(); | 108 | $crawler = $client->followRedirect(); |
109 | 109 | ||
@@ -126,10 +126,10 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
126 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); | 126 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); |
127 | $this->assertContains('varnish', $tags, 'It includes the "varnish" tag'); | 127 | $this->assertContains('varnish', $tags, 'It includes the "varnish" tag'); |
128 | $this->assertContains('PHP', $tags, 'It includes the "PHP" tag'); | 128 | $this->assertContains('PHP', $tags, 'It includes the "PHP" tag'); |
129 | $this->assertEquals(3, count($tags)); | 129 | $this->assertSame(3, count($tags)); |
130 | 130 | ||
131 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 131 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
132 | $this->assertEquals('2016-10-26', $content->getCreatedAt()->format('Y-m-d')); | 132 | $this->assertSame('2016-10-26', $content->getCreatedAt()->format('Y-m-d')); |
133 | } | 133 | } |
134 | 134 | ||
135 | public function testImportPinboardWithFileAndMarkAllAsRead() | 135 | public function testImportPinboardWithFileAndMarkAllAsRead() |
@@ -140,7 +140,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
140 | $crawler = $client->request('GET', '/import/pinboard'); | 140 | $crawler = $client->request('GET', '/import/pinboard'); |
141 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 141 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
142 | 142 | ||
143 | $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard-read.json'); | 143 | $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard-read.json'); |
144 | 144 | ||
145 | $data = [ | 145 | $data = [ |
146 | 'upload_import_file[file]' => $file, | 146 | 'upload_import_file[file]' => $file, |
@@ -149,7 +149,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
149 | 149 | ||
150 | $client->submit($form, $data); | 150 | $client->submit($form, $data); |
151 | 151 | ||
152 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 152 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
153 | 153 | ||
154 | $crawler = $client->followRedirect(); | 154 | $crawler = $client->followRedirect(); |
155 | 155 | ||
@@ -185,7 +185,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
185 | $crawler = $client->request('GET', '/import/pinboard'); | 185 | $crawler = $client->request('GET', '/import/pinboard'); |
186 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 186 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
187 | 187 | ||
188 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 188 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
189 | 189 | ||
190 | $data = [ | 190 | $data = [ |
191 | 'upload_import_file[file]' => $file, | 191 | 'upload_import_file[file]' => $file, |
@@ -193,7 +193,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
193 | 193 | ||
194 | $client->submit($form, $data); | 194 | $client->submit($form, $data); |
195 | 195 | ||
196 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 196 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
197 | 197 | ||
198 | $crawler = $client->followRedirect(); | 198 | $crawler = $client->followRedirect(); |
199 | 199 | ||
diff --git a/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php index 7d6a300f..17ce1a2a 100644 --- a/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php | |||
@@ -13,8 +13,8 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
13 | 13 | ||
14 | $crawler = $client->request('GET', '/import/pocket'); | 14 | $crawler = $client->request('GET', '/import/pocket'); |
15 | 15 | ||
16 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 16 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
17 | $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); | 17 | $this->assertSame(1, $crawler->filter('button[type=submit]')->count()); |
18 | } | 18 | } |
19 | 19 | ||
20 | public function testImportPocketWithRabbitEnabled() | 20 | public function testImportPocketWithRabbitEnabled() |
@@ -26,8 +26,8 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
26 | 26 | ||
27 | $crawler = $client->request('GET', '/import/pocket'); | 27 | $crawler = $client->request('GET', '/import/pocket'); |
28 | 28 | ||
29 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 29 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
30 | $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); | 30 | $this->assertSame(1, $crawler->filter('button[type=submit]')->count()); |
31 | 31 | ||
32 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 32 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
33 | } | 33 | } |
@@ -42,8 +42,8 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
42 | 42 | ||
43 | $crawler = $client->request('GET', '/import/pocket'); | 43 | $crawler = $client->request('GET', '/import/pocket'); |
44 | 44 | ||
45 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 45 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
46 | $this->assertEquals(1, $crawler->filter('button[type=submit]')->count()); | 46 | $this->assertSame(1, $crawler->filter('button[type=submit]')->count()); |
47 | 47 | ||
48 | $client->getContainer()->get('craue_config')->set('import_with_redis', 0); | 48 | $client->getContainer()->get('craue_config')->set('import_with_redis', 0); |
49 | } | 49 | } |
@@ -55,7 +55,7 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
55 | 55 | ||
56 | $client->request('GET', '/import/pocket/auth'); | 56 | $client->request('GET', '/import/pocket/auth'); |
57 | 57 | ||
58 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 58 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
59 | } | 59 | } |
60 | 60 | ||
61 | public function testImportPocketAuth() | 61 | public function testImportPocketAuth() |
@@ -76,7 +76,7 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
76 | 76 | ||
77 | $client->request('GET', '/import/pocket/auth'); | 77 | $client->request('GET', '/import/pocket/auth'); |
78 | 78 | ||
79 | $this->assertEquals(301, $client->getResponse()->getStatusCode()); | 79 | $this->assertSame(301, $client->getResponse()->getStatusCode()); |
80 | $this->assertContains('getpocket.com/auth/authorize', $client->getResponse()->headers->get('location')); | 80 | $this->assertContains('getpocket.com/auth/authorize', $client->getResponse()->headers->get('location')); |
81 | } | 81 | } |
82 | 82 | ||
@@ -98,9 +98,9 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
98 | 98 | ||
99 | $client->request('GET', '/import/pocket/callback'); | 99 | $client->request('GET', '/import/pocket/callback'); |
100 | 100 | ||
101 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 101 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
102 | $this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage'); | 102 | $this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage'); |
103 | $this->assertEquals('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); | 103 | $this->assertSame('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); |
104 | } | 104 | } |
105 | 105 | ||
106 | public function testImportPocketCallback() | 106 | public function testImportPocketCallback() |
@@ -132,8 +132,8 @@ class PocketControllerTest extends WallabagCoreTestCase | |||
132 | 132 | ||
133 | $client->request('GET', '/import/pocket/callback'); | 133 | $client->request('GET', '/import/pocket/callback'); |
134 | 134 | ||
135 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 135 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
136 | $this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage'); | 136 | $this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage'); |
137 | $this->assertEquals('flashes.import.notice.summary', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); | 137 | $this->assertSame('flashes.import.notice.summary', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]); |
138 | } | 138 | } |
139 | } | 139 | } |
diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index bde0a600..e1915150 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class ReadabilityControllerTest extends WallabagCoreTestCase | 8 | class ReadabilityControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/readability'); | 15 | $crawler = $client->request('GET', '/import/readability'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportReadabilityWithRabbitEnabled() | 22 | public function testImportReadabilityWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/readability'); | 29 | $crawler = $client->request('GET', '/import/readability'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportReadabilityWithRedisEnabled() | 55 | public function testImportReadabilityWithRedisEnabled() |
@@ -61,13 +61,13 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
61 | 61 | ||
62 | $crawler = $client->request('GET', '/import/readability'); | 62 | $crawler = $client->request('GET', '/import/readability'); |
63 | 63 | ||
64 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 64 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
65 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 65 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
66 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 66 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
67 | 67 | ||
68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 68 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
69 | 69 | ||
70 | $file = new UploadedFile(__DIR__.'/../fixtures/readability.json', 'readability.json'); | 70 | $file = new UploadedFile(__DIR__ . '/../fixtures/readability.json', 'readability.json'); |
71 | 71 | ||
72 | $data = [ | 72 | $data = [ |
73 | 'upload_import_file[file]' => $file, | 73 | 'upload_import_file[file]' => $file, |
@@ -75,7 +75,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
75 | 75 | ||
76 | $client->submit($form, $data); | 76 | $client->submit($form, $data); |
77 | 77 | ||
78 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 78 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
79 | 79 | ||
80 | $crawler = $client->followRedirect(); | 80 | $crawler = $client->followRedirect(); |
81 | 81 | ||
@@ -95,7 +95,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
95 | $crawler = $client->request('GET', '/import/readability'); | 95 | $crawler = $client->request('GET', '/import/readability'); |
96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 96 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
97 | 97 | ||
98 | $file = new UploadedFile(__DIR__.'/../fixtures/readability.json', 'readability.json'); | 98 | $file = new UploadedFile(__DIR__ . '/../fixtures/readability.json', 'readability.json'); |
99 | 99 | ||
100 | $data = [ | 100 | $data = [ |
101 | 'upload_import_file[file]' => $file, | 101 | 'upload_import_file[file]' => $file, |
@@ -103,7 +103,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
103 | 103 | ||
104 | $client->submit($form, $data); | 104 | $client->submit($form, $data); |
105 | 105 | ||
106 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 106 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
107 | 107 | ||
108 | $crawler = $client->followRedirect(); | 108 | $crawler = $client->followRedirect(); |
109 | 109 | ||
@@ -124,10 +124,10 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
124 | 124 | ||
125 | $tags = $content->getTags(); | 125 | $tags = $content->getTags(); |
126 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); | 126 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); |
127 | $this->assertEquals(1, count($tags)); | 127 | $this->assertSame(1, count($tags)); |
128 | 128 | ||
129 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 129 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
130 | $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); | 130 | $this->assertSame('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); |
131 | } | 131 | } |
132 | 132 | ||
133 | public function testImportReadabilityWithFileAndMarkAllAsRead() | 133 | public function testImportReadabilityWithFileAndMarkAllAsRead() |
@@ -138,7 +138,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
138 | $crawler = $client->request('GET', '/import/readability'); | 138 | $crawler = $client->request('GET', '/import/readability'); |
139 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 139 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
140 | 140 | ||
141 | $file = new UploadedFile(__DIR__.'/../fixtures/readability-read.json', 'readability-read.json'); | 141 | $file = new UploadedFile(__DIR__ . '/../fixtures/readability-read.json', 'readability-read.json'); |
142 | 142 | ||
143 | $data = [ | 143 | $data = [ |
144 | 'upload_import_file[file]' => $file, | 144 | 'upload_import_file[file]' => $file, |
@@ -147,7 +147,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
147 | 147 | ||
148 | $client->submit($form, $data); | 148 | $client->submit($form, $data); |
149 | 149 | ||
150 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 150 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
151 | 151 | ||
152 | $crawler = $client->followRedirect(); | 152 | $crawler = $client->followRedirect(); |
153 | 153 | ||
@@ -183,7 +183,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
183 | $crawler = $client->request('GET', '/import/readability'); | 183 | $crawler = $client->request('GET', '/import/readability'); |
184 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 184 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
185 | 185 | ||
186 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 186 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
187 | 187 | ||
188 | $data = [ | 188 | $data = [ |
189 | 'upload_import_file[file]' => $file, | 189 | 'upload_import_file[file]' => $file, |
@@ -191,7 +191,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
191 | 191 | ||
192 | $client->submit($form, $data); | 192 | $client->submit($form, $data); |
193 | 193 | ||
194 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 194 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
195 | 195 | ||
196 | $crawler = $client->followRedirect(); | 196 | $crawler = $client->followRedirect(); |
197 | 197 | ||
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 2c492c20..25625c35 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class WallabagV1ControllerTest extends WallabagCoreTestCase | 8 | class WallabagV1ControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 15 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportWallabagWithRabbitEnabled() | 22 | public function testImportWallabagWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 29 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportWallabagWithRedisEnabled() | 55 | public function testImportWallabagWithRedisEnabled() |
@@ -62,13 +62,13 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
62 | 62 | ||
63 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 63 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
64 | 64 | ||
65 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 65 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
66 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 66 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
67 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 67 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
68 | 68 | ||
69 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 69 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
70 | 70 | ||
71 | $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); | 71 | $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); |
72 | 72 | ||
73 | $data = [ | 73 | $data = [ |
74 | 'upload_import_file[file]' => $file, | 74 | 'upload_import_file[file]' => $file, |
@@ -76,7 +76,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
76 | 76 | ||
77 | $client->submit($form, $data); | 77 | $client->submit($form, $data); |
78 | 78 | ||
79 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 79 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
80 | 80 | ||
81 | $crawler = $client->followRedirect(); | 81 | $crawler = $client->followRedirect(); |
82 | 82 | ||
@@ -96,7 +96,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
96 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 96 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
97 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 97 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
98 | 98 | ||
99 | $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); | 99 | $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); |
100 | 100 | ||
101 | $data = [ | 101 | $data = [ |
102 | 'upload_import_file[file]' => $file, | 102 | 'upload_import_file[file]' => $file, |
@@ -104,7 +104,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
104 | 104 | ||
105 | $client->submit($form, $data); | 105 | $client->submit($form, $data); |
106 | 106 | ||
107 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 107 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
108 | 108 | ||
109 | $crawler = $client->followRedirect(); | 109 | $crawler = $client->followRedirect(); |
110 | 110 | ||
@@ -126,7 +126,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
126 | $tags = $content->getTags(); | 126 | $tags = $content->getTags(); |
127 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); | 127 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); |
128 | $this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag'); | 128 | $this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag'); |
129 | $this->assertEquals(2, count($tags)); | 129 | $this->assertSame(2, count($tags)); |
130 | 130 | ||
131 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 131 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
132 | } | 132 | } |
@@ -139,7 +139,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
139 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 139 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
140 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 140 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
141 | 141 | ||
142 | $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json'); | 142 | $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json'); |
143 | 143 | ||
144 | $data = [ | 144 | $data = [ |
145 | 'upload_import_file[file]' => $file, | 145 | 'upload_import_file[file]' => $file, |
@@ -148,7 +148,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
148 | 148 | ||
149 | $client->submit($form, $data); | 149 | $client->submit($form, $data); |
150 | 150 | ||
151 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 151 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
152 | 152 | ||
153 | $crawler = $client->followRedirect(); | 153 | $crawler = $client->followRedirect(); |
154 | 154 | ||
@@ -184,7 +184,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
184 | $crawler = $client->request('GET', '/import/wallabag-v1'); | 184 | $crawler = $client->request('GET', '/import/wallabag-v1'); |
185 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 185 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
186 | 186 | ||
187 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 187 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
188 | 188 | ||
189 | $data = [ | 189 | $data = [ |
190 | 'upload_import_file[file]' => $file, | 190 | 'upload_import_file[file]' => $file, |
@@ -192,7 +192,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
192 | 192 | ||
193 | $client->submit($form, $data); | 193 | $client->submit($form, $data); |
194 | 194 | ||
195 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 195 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
196 | 196 | ||
197 | $crawler = $client->followRedirect(); | 197 | $crawler = $client->followRedirect(); |
198 | 198 | ||
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index 24893259..a94adcaf 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php | |||
@@ -2,8 +2,8 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\ImportBundle\Controller; | 3 | namespace Tests\Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
6 | use Symfony\Component\HttpFoundation\File\UploadedFile; | 5 | use Symfony\Component\HttpFoundation\File\UploadedFile; |
6 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | ||
7 | 7 | ||
8 | class WallabagV2ControllerTest extends WallabagCoreTestCase | 8 | class WallabagV2ControllerTest extends WallabagCoreTestCase |
9 | { | 9 | { |
@@ -14,9 +14,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
14 | 14 | ||
15 | $crawler = $client->request('GET', '/import/wallabag-v2'); | 15 | $crawler = $client->request('GET', '/import/wallabag-v2'); |
16 | 16 | ||
17 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 17 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
18 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 18 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
19 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 19 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
20 | } | 20 | } |
21 | 21 | ||
22 | public function testImportWallabagWithRabbitEnabled() | 22 | public function testImportWallabagWithRabbitEnabled() |
@@ -28,9 +28,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
28 | 28 | ||
29 | $crawler = $client->request('GET', '/import/wallabag-v2'); | 29 | $crawler = $client->request('GET', '/import/wallabag-v2'); |
30 | 30 | ||
31 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 31 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
32 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 32 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
33 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 33 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
34 | 34 | ||
35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); | 35 | $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); |
36 | } | 36 | } |
@@ -49,7 +49,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
49 | 49 | ||
50 | $client->submit($form, $data); | 50 | $client->submit($form, $data); |
51 | 51 | ||
52 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 52 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
53 | } | 53 | } |
54 | 54 | ||
55 | public function testImportWallabagWithRedisEnabled() | 55 | public function testImportWallabagWithRedisEnabled() |
@@ -62,13 +62,13 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
62 | 62 | ||
63 | $crawler = $client->request('GET', '/import/wallabag-v2'); | 63 | $crawler = $client->request('GET', '/import/wallabag-v2'); |
64 | 64 | ||
65 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | 65 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
66 | $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); | 66 | $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); |
67 | $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); | 67 | $this->assertSame(1, $crawler->filter('input[type=file]')->count()); |
68 | 68 | ||
69 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 69 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
70 | 70 | ||
71 | $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); | 71 | $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); |
72 | 72 | ||
73 | $data = [ | 73 | $data = [ |
74 | 'upload_import_file[file]' => $file, | 74 | 'upload_import_file[file]' => $file, |
@@ -76,7 +76,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
76 | 76 | ||
77 | $client->submit($form, $data); | 77 | $client->submit($form, $data); |
78 | 78 | ||
79 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 79 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
80 | 80 | ||
81 | $crawler = $client->followRedirect(); | 81 | $crawler = $client->followRedirect(); |
82 | 82 | ||
@@ -96,7 +96,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
96 | $crawler = $client->request('GET', '/import/wallabag-v2'); | 96 | $crawler = $client->request('GET', '/import/wallabag-v2'); |
97 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 97 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
98 | 98 | ||
99 | $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); | 99 | $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); |
100 | 100 | ||
101 | $data = [ | 101 | $data = [ |
102 | 'upload_import_file[file]' => $file, | 102 | 'upload_import_file[file]' => $file, |
@@ -104,7 +104,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
104 | 104 | ||
105 | $client->submit($form, $data); | 105 | $client->submit($form, $data); |
106 | 106 | ||
107 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 107 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
108 | 108 | ||
109 | $crawler = $client->followRedirect(); | 109 | $crawler = $client->followRedirect(); |
110 | 110 | ||
@@ -126,7 +126,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
126 | 126 | ||
127 | $tags = $content->getTags(); | 127 | $tags = $content->getTags(); |
128 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); | 128 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); |
129 | $this->assertEquals(1, count($tags)); | 129 | $this->assertSame(1, count($tags)); |
130 | 130 | ||
131 | $content = $client->getContainer() | 131 | $content = $client->getContainer() |
132 | ->get('doctrine.orm.entity_manager') | 132 | ->get('doctrine.orm.entity_manager') |
@@ -144,10 +144,10 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
144 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); | 144 | $this->assertContains('foot', $tags, 'It includes the "foot" tag'); |
145 | $this->assertContains('mediapart', $tags, 'It includes the "mediapart" tag'); | 145 | $this->assertContains('mediapart', $tags, 'It includes the "mediapart" tag'); |
146 | $this->assertContains('blog', $tags, 'It includes the "blog" tag'); | 146 | $this->assertContains('blog', $tags, 'It includes the "blog" tag'); |
147 | $this->assertEquals(3, count($tags)); | 147 | $this->assertSame(3, count($tags)); |
148 | 148 | ||
149 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); | 149 | $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); |
150 | $this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); | 150 | $this->assertSame('2016-09-08', $content->getCreatedAt()->format('Y-m-d')); |
151 | $this->assertTrue($content->isStarred(), 'Entry is starred'); | 151 | $this->assertTrue($content->isStarred(), 'Entry is starred'); |
152 | } | 152 | } |
153 | 153 | ||
@@ -159,7 +159,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
159 | $crawler = $client->request('GET', '/import/wallabag-v2'); | 159 | $crawler = $client->request('GET', '/import/wallabag-v2'); |
160 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); | 160 | $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); |
161 | 161 | ||
162 | $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); | 162 | $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); |
163 | 163 | ||
164 | $data = [ | 164 | $data = [ |
165 | 'upload_import_file[file]' => $file, | 165 | 'upload_import_file[file]' => $file, |
@@ -167,7 +167,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
167 | 167 | ||
168 | $client->submit($form, $data); | 168 | $client->submit($form, $data); |
169 | 169 | ||
170 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | 170 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
171 | 171 | ||
172 | $crawler = $client->followRedirect(); | 172 | $crawler = $client->followRedirect(); |
173 | 173 | ||