aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php40
1 files changed, 20 insertions, 20 deletions
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
3namespace Tests\Wallabag\ImportBundle\Controller; 3namespace Tests\Wallabag\ImportBundle\Controller;
4 4
5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
6use Symfony\Component\HttpFoundation\File\UploadedFile; 5use Symfony\Component\HttpFoundation\File\UploadedFile;
6use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
7 7
8class WallabagV1ControllerTest extends WallabagCoreTestCase 8class 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