X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FImportBundle%2FController%2FPinboardControllerTest.php;h=c307f96c94be3b61f34752b9033fb0e42546bab5;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=e2b6e7b6eb1d1f6d14180a7fda4630a394896595;hpb=822c877949aff8ae57677671115f8f4fc69588d5;p=github%2Fwallabag%2Fwallabag.git 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 @@ namespace Tests\Wallabag\ImportBundle\Controller; -use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; class PinboardControllerTest extends WallabagCoreTestCase { @@ -14,9 +14,9 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); - $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); - $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); + $this->assertSame(200, $client->getResponse()->getStatusCode()); + $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); + $this->assertSame(1, $crawler->filter('input[type=file]')->count()); } public function testImportPinboardWithRabbitEnabled() @@ -28,9 +28,9 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); - $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); - $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); + $this->assertSame(200, $client->getResponse()->getStatusCode()); + $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); + $this->assertSame(1, $crawler->filter('input[type=file]')->count()); $client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0); } @@ -49,7 +49,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $client->submit($form, $data); - $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertSame(200, $client->getResponse()->getStatusCode()); } public function testImportPinboardWithRedisEnabled() @@ -61,13 +61,13 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); - $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->assertEquals(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); - $this->assertEquals(1, $crawler->filter('input[type=file]')->count()); + $this->assertSame(200, $client->getResponse()->getStatusCode()); + $this->assertSame(1, $crawler->filter('form[name=upload_import_file] > button[type=submit]')->count()); + $this->assertSame(1, $crawler->filter('input[type=file]')->count()); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard.json'); + $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard.json'); $data = [ 'upload_import_file[file]' => $file, @@ -75,7 +75,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $client->submit($form, $data); - $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertSame(302, $client->getResponse()->getStatusCode()); $crawler = $client->followRedirect(); @@ -95,7 +95,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard.json'); + $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard.json'); $data = [ 'upload_import_file[file]' => $file, @@ -103,7 +103,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $client->submit($form, $data); - $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertSame(302, $client->getResponse()->getStatusCode()); $crawler = $client->followRedirect(); @@ -126,10 +126,10 @@ class PinboardControllerTest extends WallabagCoreTestCase $this->assertContains('foot', $tags, 'It includes the "foot" tag'); $this->assertContains('varnish', $tags, 'It includes the "varnish" tag'); $this->assertContains('PHP', $tags, 'It includes the "PHP" tag'); - $this->assertEquals(3, count($tags)); + $this->assertSame(3, count($tags)); $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); - $this->assertEquals('2016-10-26', $content->getCreatedAt()->format('Y-m-d')); + $this->assertSame('2016-10-26', $content->getCreatedAt()->format('Y-m-d')); } public function testImportPinboardWithFileAndMarkAllAsRead() @@ -140,7 +140,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__.'/../fixtures/pinboard_export', 'pinboard-read.json'); + $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard-read.json'); $data = [ 'upload_import_file[file]' => $file, @@ -149,7 +149,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $client->submit($form, $data); - $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertSame(302, $client->getResponse()->getStatusCode()); $crawler = $client->followRedirect(); @@ -185,7 +185,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, @@ -193,7 +193,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $client->submit($form, $data); - $this->assertEquals(302, $client->getResponse()->getStatusCode()); + $this->assertSame(302, $client->getResponse()->getStatusCode()); $crawler = $client->followRedirect();