1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

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
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
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 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();