diff options
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php')
-rw-r--r-- | tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php | 42 |
1 files changed, 21 insertions, 21 deletions
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 | ||