Add a real configuration for CS-Fixer

This commit is contained in:
Jeremy Benoist
2017-07-01 09:52:38 +02:00
parent 822c877949
commit f808b01692
170 changed files with 3147 additions and 3120 deletions

View File

@ -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 ChromeControllerTest extends WallabagCoreTestCase
{
@ -14,9 +14,9 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/chrome');
$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 testImportChromeWithRabbitEnabled()
@ -28,9 +28,9 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/chrome');
$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 ChromeControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertSame(200, $client->getResponse()->getStatusCode());
}
public function testImportChromeWithRedisEnabled()
@ -61,13 +61,13 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/chrome');
$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/chrome-bookmarks', 'Bookmarks');
$file = new UploadedFile(__DIR__ . '/../fixtures/chrome-bookmarks', 'Bookmarks');
$data = [
'upload_import_file[file]' => $file,
@ -75,7 +75,7 @@ class ChromeControllerTest 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 ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/chrome');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/chrome-bookmarks', 'Bookmarks');
$file = new UploadedFile(__DIR__ . '/../fixtures/chrome-bookmarks', 'Bookmarks');
$data = [
'upload_import_file[file]' => $file,
@ -103,7 +103,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -120,11 +120,11 @@ class ChromeControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok');
$this->assertEquals(1, count($content->getTags()));
$this->assertSame(1, count($content->getTags()));
$createdAt = $content->getCreatedAt();
$this->assertEquals('2011', $createdAt->format('Y'));
$this->assertEquals('07', $createdAt->format('m'));
$this->assertSame('2011', $createdAt->format('Y'));
$this->assertSame('07', $createdAt->format('m'));
}
public function testImportWallabagWithEmptyFile()
@ -135,7 +135,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/chrome');
$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,
@ -143,7 +143,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();

View File

@ -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 FirefoxControllerTest extends WallabagCoreTestCase
{
@ -14,9 +14,9 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/firefox');
$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 testImportFirefoxWithRabbitEnabled()
@ -28,9 +28,9 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/firefox');
$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 FirefoxControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertSame(200, $client->getResponse()->getStatusCode());
}
public function testImportFirefoxWithRedisEnabled()
@ -61,13 +61,13 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/firefox');
$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/firefox-bookmarks.json', 'Bookmarks');
$file = new UploadedFile(__DIR__ . '/../fixtures/firefox-bookmarks.json', 'Bookmarks');
$data = [
'upload_import_file[file]' => $file,
@ -75,7 +75,7 @@ class FirefoxControllerTest 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 FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/firefox');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/firefox-bookmarks.json', 'Bookmarks');
$file = new UploadedFile(__DIR__ . '/../fixtures/firefox-bookmarks.json', 'Bookmarks');
$data = [
'upload_import_file[file]' => $file,
@ -103,7 +103,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -121,7 +121,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok');
$this->assertEquals(3, count($content->getTags()));
$this->assertSame(3, count($content->getTags()));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -136,8 +136,8 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$this->assertEmpty($content->getLanguage(), 'Language for https://stackoverflow.com is ok');
$createdAt = $content->getCreatedAt();
$this->assertEquals('2013', $createdAt->format('Y'));
$this->assertEquals('12', $createdAt->format('m'));
$this->assertSame('2013', $createdAt->format('Y'));
$this->assertSame('12', $createdAt->format('m'));
}
public function testImportWallabagWithEmptyFile()
@ -148,7 +148,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/firefox');
$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,
@ -156,7 +156,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();

View File

@ -12,7 +12,7 @@ class ImportControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/');
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('login', $client->getResponse()->headers->get('location'));
}
@ -23,7 +23,7 @@ class ImportControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(8, $crawler->filter('blockquote')->count());
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertSame(8, $crawler->filter('blockquote')->count());
}
}

View File

@ -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 InstapaperControllerTest extends WallabagCoreTestCase
{
@ -14,9 +14,9 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/instapaper');
$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 testImportInstapaperWithRabbitEnabled()
@ -28,9 +28,9 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/instapaper');
$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 InstapaperControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertSame(200, $client->getResponse()->getStatusCode());
}
public function testImportInstapaperWithRedisEnabled()
@ -61,13 +61,13 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/instapaper');
$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/instapaper-export.csv', 'instapaper.csv');
$file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper.csv');
$data = [
'upload_import_file[file]' => $file,
@ -75,7 +75,7 @@ class InstapaperControllerTest 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 InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/instapaper-export.csv', 'instapaper.csv');
$file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper.csv');
$data = [
'upload_import_file[file]' => $file,
@ -103,7 +103,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -122,7 +122,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok');
$this->assertContains('foot', $content->getTags(), 'It includes the "foot" tag');
$this->assertEquals(1, count($content->getTags()));
$this->assertSame(1, count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$content = $client->getContainer()
@ -136,7 +136,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$this->assertContains('foot', $content->getTags());
$this->assertContains('test_tag', $content->getTags());
$this->assertEquals(2, count($content->getTags()));
$this->assertSame(2, count($content->getTags()));
}
public function testImportInstapaperWithFileAndMarkAllAsRead()
@ -147,7 +147,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/instapaper-export.csv', 'instapaper-read.csv');
$file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper-read.csv');
$data = [
'upload_import_file[file]' => $file,
@ -156,7 +156,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -192,7 +192,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/instapaper');
$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,
@ -200,7 +200,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();

View File

@ -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();

View File

@ -13,8 +13,8 @@ class PocketControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/pocket');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(1, $crawler->filter('button[type=submit]')->count());
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertSame(1, $crawler->filter('button[type=submit]')->count());
}
public function testImportPocketWithRabbitEnabled()
@ -26,8 +26,8 @@ class PocketControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/pocket');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(1, $crawler->filter('button[type=submit]')->count());
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertSame(1, $crawler->filter('button[type=submit]')->count());
$client->getContainer()->get('craue_config')->set('import_with_rabbitmq', 0);
}
@ -42,8 +42,8 @@ class PocketControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/pocket');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(1, $crawler->filter('button[type=submit]')->count());
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertSame(1, $crawler->filter('button[type=submit]')->count());
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
}
@ -55,7 +55,7 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/auth');
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
}
public function testImportPocketAuth()
@ -76,7 +76,7 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/auth');
$this->assertEquals(301, $client->getResponse()->getStatusCode());
$this->assertSame(301, $client->getResponse()->getStatusCode());
$this->assertContains('getpocket.com/auth/authorize', $client->getResponse()->headers->get('location'));
}
@ -98,9 +98,9 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/callback');
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
$this->assertEquals('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
$this->assertSame('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
}
public function testImportPocketCallback()
@ -132,8 +132,8 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/callback');
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
$this->assertEquals('flashes.import.notice.summary', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
$this->assertSame('flashes.import.notice.summary', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
}
}

View File

@ -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 ReadabilityControllerTest extends WallabagCoreTestCase
{
@ -14,9 +14,9 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/readability');
$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 testImportReadabilityWithRabbitEnabled()
@ -28,9 +28,9 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/readability');
$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 ReadabilityControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertSame(200, $client->getResponse()->getStatusCode());
}
public function testImportReadabilityWithRedisEnabled()
@ -61,13 +61,13 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/readability');
$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/readability.json', 'readability.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/readability.json', 'readability.json');
$data = [
'upload_import_file[file]' => $file,
@ -75,7 +75,7 @@ class ReadabilityControllerTest 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 ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/readability.json', 'readability.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/readability.json', 'readability.json');
$data = [
'upload_import_file[file]' => $file,
@ -103,7 +103,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -124,10 +124,10 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertEquals(1, count($tags));
$this->assertSame(1, count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
$this->assertSame('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
}
public function testImportReadabilityWithFileAndMarkAllAsRead()
@ -138,7 +138,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/readability-read.json', 'readability-read.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/readability-read.json', 'readability-read.json');
$data = [
'upload_import_file[file]' => $file,
@ -147,7 +147,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -183,7 +183,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/readability');
$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,
@ -191,7 +191,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();

View File

@ -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 WallabagV1ControllerTest extends WallabagCoreTestCase
{
@ -14,9 +14,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v1');
$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 testImportWallabagWithRabbitEnabled()
@ -28,9 +28,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v1');
$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 WallabagV1ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertSame(200, $client->getResponse()->getStatusCode());
}
public function testImportWallabagWithRedisEnabled()
@ -62,13 +62,13 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v1');
$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/wallabag-v1.json', 'wallabag-v1.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1.json', 'wallabag-v1.json');
$data = [
'upload_import_file[file]' => $file,
@ -76,7 +76,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -96,7 +96,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1.json', 'wallabag-v1.json');
$data = [
'upload_import_file[file]' => $file,
@ -104,7 +104,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -126,7 +126,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag');
$this->assertEquals(2, count($tags));
$this->assertSame(2, count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
}
@ -139,7 +139,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json');
$data = [
'upload_import_file[file]' => $file,
@ -148,7 +148,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -184,7 +184,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v1');
$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,
@ -192,7 +192,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();

View File

@ -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 WallabagV2ControllerTest extends WallabagCoreTestCase
{
@ -14,9 +14,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v2');
$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 testImportWallabagWithRabbitEnabled()
@ -28,9 +28,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v2');
$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 WallabagV2ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertSame(200, $client->getResponse()->getStatusCode());
}
public function testImportWallabagWithRedisEnabled()
@ -62,13 +62,13 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v2');
$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/wallabag-v2.json', 'wallabag-v2.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v2.json', 'wallabag-v2.json');
$data = [
'upload_import_file[file]' => $file,
@ -76,7 +76,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -96,7 +96,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v2');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json');
$file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v2.json', 'wallabag-v2.json');
$data = [
'upload_import_file[file]' => $file,
@ -104,7 +104,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
@ -126,7 +126,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertEquals(1, count($tags));
$this->assertSame(1, count($tags));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -144,10 +144,10 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertContains('mediapart', $tags, 'It includes the "mediapart" tag');
$this->assertContains('blog', $tags, 'It includes the "blog" tag');
$this->assertEquals(3, count($tags));
$this->assertSame(3, count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
$this->assertSame('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
$this->assertTrue($content->isStarred(), 'Entry is starred');
}
@ -159,7 +159,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/import/wallabag-v2');
$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,
@ -167,7 +167,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();