aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php')
-rw-r--r--tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php40
1 files changed, 20 insertions, 20 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
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 ChromeControllerTest extends WallabagCoreTestCase 8class 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