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