Upgrade to Symfony 4.4

- disable autowiring for Event (because the Entry entity was injected)
- rename `getClient()` for test to `getTestClient()` to avoid error while overriding (from `BrowserKitAssertionsTrait`)
This commit is contained in:
Jeremy Benoist 2022-11-23 17:09:32 +01:00
parent 655ec5e07a
commit aa5c7f05b8
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
43 changed files with 966 additions and 1239 deletions

View file

@ -41,7 +41,7 @@ services:
Wallabag\CoreBundle\: Wallabag\CoreBundle\:
resource: '../../src/Wallabag/CoreBundle/*' resource: '../../src/Wallabag/CoreBundle/*'
exclude: '../../src/Wallabag/CoreBundle/{Controller,Entity}' exclude: ['../../src/Wallabag/CoreBundle/{Controller,Entity}', '../../src/Wallabag/CoreBundle/Event/*Event.php']
Wallabag\ImportBundle\: Wallabag\ImportBundle\:
resource: '../../src/Wallabag/ImportBundle/*' resource: '../../src/Wallabag/ImportBundle/*'

View file

@ -107,10 +107,10 @@
"sentry/sentry-symfony": "3.5.3", "sentry/sentry-symfony": "3.5.3",
"stof/doctrine-extensions-bundle": "^1.2", "stof/doctrine-extensions-bundle": "^1.2",
"swiftmailer/swiftmailer": "^6.3", "swiftmailer/swiftmailer": "^6.3",
"symfony/dom-crawler": "^3.4", "symfony/dom-crawler": "^4.0",
"symfony/monolog-bundle": "^3.1", "symfony/monolog-bundle": "^3.1",
"symfony/swiftmailer-bundle": "^3.2", "symfony/swiftmailer-bundle": "^3.2",
"symfony/symfony": "3.4.*", "symfony/symfony": "^4.0",
"tecnickcom/tcpdf": "^6.3.0", "tecnickcom/tcpdf": "^6.3.0",
"twig/extensions": "^1.5", "twig/extensions": "^1.5",
"twig/twig": "^2.15", "twig/twig": "^2.15",

1579
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -8,12 +8,9 @@ parameters:
- tests - tests
symfony: symfony:
container_xml_path: %rootDir%/../../../var/cache/test/appTestDebugProjectContainer.xml container_xml_path: %rootDir%/../../../var/cache/test/appAppKernelTestDebugContainer.xml
bootstrapFiles: bootstrapFiles:
- vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php - vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php
inferPrivatePropertyTypeFromConstructor: true inferPrivatePropertyTypeFromConstructor: true
ignoreErrors:
- '#^Service ".+" is private\.?#'

View file

@ -717,10 +717,10 @@ class EntryRestController extends WallabagRestController
] ]
); );
} catch (\Exception $e) { } catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [ // $this->get('logger')->error('Error while saving an entry', [
'exception' => $e, // 'exception' => $e,
'entry' => $entry, // 'entry' => $entry,
]); // ]);
} }
if (null !== $data['isArchived']) { if (null !== $data['isArchived']) {
@ -911,10 +911,10 @@ class EntryRestController extends WallabagRestController
true true
); );
} catch (\Exception $e) { } catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [ // $this->get('logger')->error('Error while saving an entry', [
'exception' => $e, // 'exception' => $e,
'entry' => $entry, // 'entry' => $entry,
]); // ]);
} }
} }
@ -1014,10 +1014,10 @@ class EntryRestController extends WallabagRestController
try { try {
$this->get(ContentProxy::class)->updateEntry($entry, $entry->getUrl()); $this->get(ContentProxy::class)->updateEntry($entry, $entry->getUrl());
} catch (\Exception $e) { } catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [ // $this->get('logger')->error('Error while saving an entry', [
'exception' => $e, // 'exception' => $e,
'entry' => $entry, // 'entry' => $entry,
]); // ]);
return new JsonResponse([], 304); return new JsonResponse([], 304);
} }

View file

@ -697,10 +697,10 @@ class EntryController extends Controller
try { try {
$this->get(ContentProxy::class)->updateEntry($entry, $entry->getUrl()); $this->get(ContentProxy::class)->updateEntry($entry, $entry->getUrl());
} catch (\Exception $e) { } catch (\Exception $e) {
$this->get('logger')->error('Error while saving an entry', [ // $this->logger->error('Error while saving an entry', [
'exception' => $e, // 'exception' => $e,
'entry' => $entry, // 'entry' => $entry,
]); // ]);
$message = 'flashes.entry.notice.' . $prefixMessage . '_failed'; $message = 'flashes.entry.notice.' . $prefixMessage . '_failed';
} }

View file

@ -11,7 +11,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testCreateClient() public function testCreateClient()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$nbClients = $em->getRepository(Client::class)->findAll(); $nbClients = $em->getRepository(Client::class)->findAll();
@ -37,7 +37,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testCreateToken() public function testCreateToken()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$apiClient = $this->createApiClientForUser('admin'); $apiClient = $this->createApiClientForUser('admin');
$client->request('POST', '/oauth/v2/token', [ $client->request('POST', '/oauth/v2/token', [
@ -59,7 +59,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testCreateTokenWithBadClientId() public function testCreateTokenWithBadClientId()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('POST', '/oauth/v2/token', [ $client->request('POST', '/oauth/v2/token', [
'grant_type' => 'password', 'grant_type' => 'password',
'client_id' => '$WALLABAG_CLIENT_ID', 'client_id' => '$WALLABAG_CLIENT_ID',
@ -74,7 +74,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testListingClient() public function testListingClient()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$nbClients = $em->getRepository(Client::class)->findAll(); $nbClients = $em->getRepository(Client::class)->findAll();
@ -86,7 +86,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testDeveloperHowto() public function testDeveloperHowto()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/developer/howto/first-app'); $crawler = $client->request('GET', '/developer/howto/first-app');
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());
@ -94,7 +94,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
public function testRemoveClient() public function testRemoveClient()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$adminApiClient = $this->createApiClientForUser('admin'); $adminApiClient = $this->createApiClientForUser('admin');
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
@ -134,7 +134,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
*/ */
private function createApiClientForUser($username, $grantTypes = ['password']) private function createApiClientForUser($username, $grantTypes = ['password'])
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$userManager = $client->getContainer()->get('fos_user.user_manager.test'); $userManager = $client->getContainer()->get('fos_user.user_manager.test');
$user = $userManager->findUserBy(['username' => $username]); $user = $userManager->findUserBy(['username' => $username]);

View file

@ -372,7 +372,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
foreach (['self', 'first', 'last'] as $link) { foreach (['self', 'first', 'last'] as $link) {
$this->assertArrayHasKey('href', $content['_links'][$link]); $this->assertArrayHasKey('href', $content['_links'][$link]);
$this->assertStringContainsString('tags=' . urlencode('foo,bar'), $content['_links'][$link]['href']); $this->assertStringContainsString('tags=foo,bar', $content['_links'][$link]['href']);
} }
$this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));

View file

@ -13,7 +13,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
{ {
public function testRunCleanDuplicates() public function testRunCleanDuplicates()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates'); $command = $application->find('wallabag:clean-duplicates');
@ -26,7 +26,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testRunCleanDuplicatesCommandWithBadUsername() public function testRunCleanDuplicatesCommandWithBadUsername()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates'); $command = $application->find('wallabag:clean-duplicates');
@ -40,7 +40,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testRunCleanDuplicatesCommandForUser() public function testRunCleanDuplicatesCommandForUser()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates'); $command = $application->find('wallabag:clean-duplicates');
@ -55,7 +55,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testDuplicate() public function testDuplicate()
{ {
$url = 'https://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html'; $url = 'https://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html';
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$this->logInAs('admin'); $this->logInAs('admin');
@ -79,7 +79,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
$nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId()); $nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertCount(2, $nbEntries); $this->assertCount(2, $nbEntries);
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates'); $command = $application->find('wallabag:clean-duplicates');

View file

@ -14,7 +14,7 @@ class ExportCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class); $this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments (missing: "username")'); $this->expectExceptionMessage('Not enough arguments (missing: "username")');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:export'); $command = $application->find('wallabag:export');
@ -24,7 +24,7 @@ class ExportCommandTest extends WallabagCoreTestCase
public function testExportCommandWithBadUsername() public function testExportCommandWithBadUsername()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:export'); $command = $application->find('wallabag:export');
@ -38,7 +38,7 @@ class ExportCommandTest extends WallabagCoreTestCase
public function testExportCommand() public function testExportCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:export'); $command = $application->find('wallabag:export');
@ -54,7 +54,7 @@ class ExportCommandTest extends WallabagCoreTestCase
public function testExportCommandWithSpecialPath() public function testExportCommandWithSpecialPath()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:export'); $command = $application->find('wallabag:export');

View file

@ -13,7 +13,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
{ {
public function testRunGenerateUrlHashesCommand() public function testRunGenerateUrlHashesCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls'); $command = $application->find('wallabag:generate-hashed-urls');
@ -26,7 +26,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
public function testRunGenerateUrlHashesCommandWithBadUsername() public function testRunGenerateUrlHashesCommandWithBadUsername()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls'); $command = $application->find('wallabag:generate-hashed-urls');
@ -40,7 +40,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
public function testRunGenerateUrlHashesCommandForUser() public function testRunGenerateUrlHashesCommandForUser()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls'); $command = $application->find('wallabag:generate-hashed-urls');
@ -55,7 +55,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
public function testGenerateUrls() public function testGenerateUrls()
{ {
$url = 'http://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html'; $url = 'http://www.lemonde.fr/sport/visuel/2017/05/05/rondelle-prison-blanchissage-comprendre-le-hockey-sur-glace_5122587_3242.html';
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$this->logInAs('admin'); $this->logInAs('admin');
@ -68,7 +68,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
$em->persist($entry1); $em->persist($entry1);
$em->flush(); $em->flush();
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls'); $command = $application->find('wallabag:generate-hashed-urls');

View file

@ -33,7 +33,7 @@ class InstallCommandTest extends WallabagCoreTestCase
parent::setUp(); parent::setUp();
/** @var Connection $connection */ /** @var Connection $connection */
$connection = $this->getClient()->getContainer()->get(ManagerRegistry::class)->getConnection(); $connection = $this->getTestClient()->getContainer()->get(ManagerRegistry::class)->getConnection();
if ($connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { if ($connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {
/* /*
* LOG: statement: CREATE DATABASE "wallabag" * LOG: statement: CREATE DATABASE "wallabag"
@ -61,7 +61,7 @@ class InstallCommandTest extends WallabagCoreTestCase
parent::setUp(); parent::setUp();
} }
$this->resetDatabase($this->getClient()); $this->resetDatabase($this->getTestClient());
} }
protected function tearDown(): void protected function tearDown(): void
@ -84,7 +84,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommand() public function testRunInstallCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */ /** @var InstallCommand $command */
$command = $application->find('wallabag:install'); $command = $application->find('wallabag:install');
@ -108,7 +108,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandWithReset() public function testRunInstallCommandWithReset()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */ /** @var InstallCommand $command */
$command = $application->find('wallabag:install'); $command = $application->find('wallabag:install');
@ -139,11 +139,11 @@ class InstallCommandTest extends WallabagCoreTestCase
{ {
// skipped SQLite check when database is removed because while testing for the connection, // skipped SQLite check when database is removed because while testing for the connection,
// the driver will create the file (so the database) before testing if database exist // the driver will create the file (so the database) before testing if database exist
if ($this->getClient()->getContainer()->get(ManagerRegistry::class)->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { if ($this->getTestClient()->getContainer()->get(ManagerRegistry::class)->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) {
$this->markTestSkipped('SQLite spotted: can\'t test with database removed.'); $this->markTestSkipped('SQLite spotted: can\'t test with database removed.');
} }
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
// drop database first, so the install command won't ask to reset things // drop database first, so the install command won't ask to reset things
$command = $application->find('doctrine:database:drop'); $command = $application->find('doctrine:database:drop');
@ -177,7 +177,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandChooseResetSchema() public function testRunInstallCommandChooseResetSchema()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */ /** @var InstallCommand $command */
$command = $application->find('wallabag:install'); $command = $application->find('wallabag:install');
@ -201,7 +201,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandChooseNothing() public function testRunInstallCommandChooseNothing()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
// drop database first, so the install command won't ask to reset things // drop database first, so the install command won't ask to reset things
$command = $application->find('doctrine:database:drop'); $command = $application->find('doctrine:database:drop');
@ -209,7 +209,7 @@ class InstallCommandTest extends WallabagCoreTestCase
'--force' => true, '--force' => true,
]), new NullOutput()); ]), new NullOutput());
$this->getClient()->getContainer()->get(ManagerRegistry::class)->getConnection()->close(); $this->getTestClient()->getContainer()->get(ManagerRegistry::class)->getConnection()->close();
$command = $application->find('doctrine:database:create'); $command = $application->find('doctrine:database:create');
$command->run(new ArrayInput([]), new NullOutput()); $command->run(new ArrayInput([]), new NullOutput());
@ -233,7 +233,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandNoInteraction() public function testRunInstallCommandNoInteraction()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */ /** @var InstallCommand $command */
$command = $application->find('wallabag:install'); $command = $application->find('wallabag:install');

View file

@ -10,7 +10,7 @@ class ListUserCommandTest extends WallabagCoreTestCase
{ {
public function testRunListUserCommand() public function testRunListUserCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:list'); $command = $application->find('wallabag:user:list');
@ -22,7 +22,7 @@ class ListUserCommandTest extends WallabagCoreTestCase
public function testRunListUserCommandWithLimit() public function testRunListUserCommandWithLimit()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:list'); $command = $application->find('wallabag:user:list');
@ -36,7 +36,7 @@ class ListUserCommandTest extends WallabagCoreTestCase
public function testRunListUserCommandWithSearch() public function testRunListUserCommandWithSearch()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:list'); $command = $application->find('wallabag:user:list');
@ -50,7 +50,7 @@ class ListUserCommandTest extends WallabagCoreTestCase
public function testRunListUserCommandWithSearchAndLimit() public function testRunListUserCommandWithSearchAndLimit()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:list'); $command = $application->find('wallabag:user:list');

View file

@ -25,7 +25,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
{ {
parent::setUp(); parent::setUp();
$userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository.test'); $userRepository = $this->getTestClient()->getContainer()->get('wallabag_user.user_repository.test');
$user = $userRepository->findOneByUserName('admin'); $user = $userRepository->findOneByUserName('admin');
$this->adminEntry = new Entry($user); $this->adminEntry = new Entry($user);
@ -49,7 +49,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
*/ */
public function testRunReloadEntryCommand() public function testRunReloadEntryCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:entry:reload'); $command = $application->find('wallabag:entry:reload');
$tester = new CommandTester($command); $tester = new CommandTester($command);
@ -57,7 +57,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
'interactive' => false, 'interactive' => false,
]); ]);
$reloadedEntries = $this->getClient() $reloadedEntries = $this->getTestClient()
->getContainer() ->getContainer()
->get('wallabag_core.entry_repository.test') ->get('wallabag_core.entry_repository.test')
->findById([$this->adminEntry->getId(), $this->bobEntry->getId()]); ->findById([$this->adminEntry->getId(), $this->bobEntry->getId()]);
@ -74,7 +74,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
*/ */
public function testRunReloadEntryWithUsernameCommand() public function testRunReloadEntryWithUsernameCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:entry:reload'); $command = $application->find('wallabag:entry:reload');
$tester = new CommandTester($command); $tester = new CommandTester($command);
@ -84,7 +84,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
'interactive' => false, 'interactive' => false,
]); ]);
$entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository.test'); $entryRepository = $this->getTestClient()->getContainer()->get('wallabag_core.entry_repository.test');
$reloadedAdminEntry = $entryRepository->find($this->adminEntry->getId()); $reloadedAdminEntry = $entryRepository->find($this->adminEntry->getId());
$this->assertNotEmpty($reloadedAdminEntry->getContent()); $this->assertNotEmpty($reloadedAdminEntry->getContent());
@ -97,7 +97,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
public function testRunReloadEntryWithoutEntryCommand() public function testRunReloadEntryWithoutEntryCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:entry:reload'); $command = $application->find('wallabag:entry:reload');
$tester = new CommandTester($command); $tester = new CommandTester($command);

View file

@ -16,7 +16,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class); $this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments'); $this->expectExceptionMessage('Not enough arguments');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:show'); $command = $application->find('wallabag:user:show');
@ -26,7 +26,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
public function testRunShowUserCommandWithBadUsername() public function testRunShowUserCommandWithBadUsername()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:show'); $command = $application->find('wallabag:user:show');
@ -40,7 +40,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
public function testRunShowUserCommandForUser() public function testRunShowUserCommandForUser()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:show'); $command = $application->find('wallabag:user:show');
@ -58,7 +58,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
public function testShowUser() public function testShowUser()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$this->logInAs('admin'); $this->logInAs('admin');
@ -71,7 +71,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
$em->flush(); $em->flush();
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:user:show'); $command = $application->find('wallabag:user:show');

View file

@ -14,7 +14,7 @@ class TagAllCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class); $this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments (missing: "username")'); $this->expectExceptionMessage('Not enough arguments (missing: "username")');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:tag:all'); $command = $application->find('wallabag:tag:all');
@ -24,7 +24,7 @@ class TagAllCommandTest extends WallabagCoreTestCase
public function testRunTagAllCommandWithBadUsername() public function testRunTagAllCommandWithBadUsername()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:tag:all'); $command = $application->find('wallabag:tag:all');
@ -38,7 +38,7 @@ class TagAllCommandTest extends WallabagCoreTestCase
public function testRunTagAllCommand() public function testRunTagAllCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:tag:all'); $command = $application->find('wallabag:tag:all');

View file

@ -20,7 +20,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
{ {
public function testLogin() public function testLogin()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/new'); $client->request('GET', '/new');
@ -31,7 +31,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testIndex() public function testIndex()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -46,7 +46,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUpdate() public function testUpdate()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -73,7 +73,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeReadingSpeed() public function testChangeReadingSpeed()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/test-entry1') $entry->setUrl('http://0.0.0.0/test-entry1')
@ -131,7 +131,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUpdateFailed($data) public function testUpdateFailed($data)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -191,7 +191,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangePasswordFailed($data, $expectedMessage) public function testChangePasswordFailed($data, $expectedMessage)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -210,7 +210,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangePassword() public function testChangePassword()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -259,7 +259,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserFailed($data, $expectedMessage) public function testUserFailed($data, $expectedMessage)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -278,7 +278,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserUpdate() public function testUserUpdate()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -304,7 +304,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testFeedUpdateResetToken() public function testFeedUpdateResetToken()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// reset the token // reset the token
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
@ -340,7 +340,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testGenerateTokenAjax() public function testGenerateTokenAjax()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request( $client->request(
'GET', 'GET',
@ -358,7 +358,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testRevokeTokenAjax() public function testRevokeTokenAjax()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request( $client->request(
'GET', 'GET',
@ -374,7 +374,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testFeedUpdate() public function testFeedUpdate()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -402,7 +402,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
[ [
'feed_config[feed_limit]' => 0, 'feed_config[feed_limit]' => 0,
], ],
'This value should be 1 or more.', 'This value should be between 1 and 100000.',
], ],
[ [
[ [
@ -419,7 +419,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testFeedFailed($data, $expectedMessage) public function testFeedFailed($data, $expectedMessage)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -438,7 +438,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testTaggingRuleCreation() public function testTaggingRuleCreation()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -525,7 +525,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testTaggingRuleCreationFail($data, $messages) public function testTaggingRuleCreationFail($data, $messages)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -547,7 +547,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testTaggingRuleTooLong() public function testTaggingRuleTooLong()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -570,7 +570,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDeletingTaggingRuleFromAnOtherUser() public function testDeletingTaggingRuleFromAnOtherUser()
{ {
$this->logInAs('bob'); $this->logInAs('bob');
$client = $this->getClient(); $client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class) $rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(TaggingRule::class) ->getRepository(TaggingRule::class)
@ -586,7 +586,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testEditingTaggingRuleFromAnOtherUser() public function testEditingTaggingRuleFromAnOtherUser()
{ {
$this->logInAs('bob'); $this->logInAs('bob');
$client = $this->getClient(); $client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class) $rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(TaggingRule::class) ->getRepository(TaggingRule::class)
@ -602,7 +602,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testIgnoreOriginRuleCreation() public function testIgnoreOriginRuleCreation()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -685,7 +685,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testIgnoreOriginRuleCreationFail($data, $messages) public function testIgnoreOriginRuleCreationFail($data, $messages)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -707,7 +707,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDeletingIgnoreOriginRuleFromAnOtherUser() public function testDeletingIgnoreOriginRuleFromAnOtherUser()
{ {
$this->logInAs('bob'); $this->logInAs('bob');
$client = $this->getClient(); $client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class) $rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(IgnoreOriginUserRule::class) ->getRepository(IgnoreOriginUserRule::class)
@ -723,7 +723,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testEditingIgnoreOriginRuleFromAnOtherUser() public function testEditingIgnoreOriginRuleFromAnOtherUser()
{ {
$this->logInAs('bob'); $this->logInAs('bob');
$client = $this->getClient(); $client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class) $rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(IgnoreOriginUserRule::class) ->getRepository(IgnoreOriginUserRule::class)
@ -739,7 +739,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDemoMode() public function testDemoMode()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$config = $client->getContainer()->get(Config::class); $config = $client->getContainer()->get(Config::class);
$config->set('demo_mode_enabled', 1); $config->set('demo_mode_enabled', 1);
@ -769,7 +769,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDeleteUserButtonVisibility() public function testDeleteUserButtonVisibility()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -820,7 +820,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
*/ */
public function testDeleteAccount() public function testDeleteAccount()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = new User(); $user = new User();
@ -889,7 +889,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testReset() public function testReset()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
@ -976,7 +976,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testResetArchivedEntries() public function testResetArchivedEntries()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
@ -1054,7 +1054,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testResetEntriesCascade() public function testResetEntriesCascade()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
@ -1113,7 +1113,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testSwitchViewMode() public function testSwitchViewMode()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/unread/list'); $client->request('GET', '/unread/list');
@ -1131,7 +1131,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeLocaleWithoutReferer() public function testChangeLocaleWithoutReferer()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/locale/de'); $client->request('GET', '/locale/de');
$client->followRedirect(); $client->followRedirect();
@ -1142,7 +1142,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeLocaleWithReferer() public function testChangeLocaleWithReferer()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/login'); $client->request('GET', '/login');
$client->request('GET', '/locale/de'); $client->request('GET', '/locale/de');
@ -1154,7 +1154,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeLocaleToBadLocale() public function testChangeLocaleToBadLocale()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/login'); $client->request('GET', '/login');
$client->request('GET', '/locale/yuyuyuyu'); $client->request('GET', '/locale/yuyuyuyu');
@ -1167,7 +1167,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserEnable2faEmail() public function testUserEnable2faEmail()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/email'); $crawler = $client->request('GET', '/config/otp/email');
@ -1194,7 +1194,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserDisable2faEmail() public function testUserDisable2faEmail()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/email/disable'); $crawler = $client->request('GET', '/config/otp/email/disable');
@ -1217,7 +1217,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserEnable2faGoogle() public function testUserEnable2faGoogle()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/app'); $crawler = $client->request('GET', '/config/otp/app');
@ -1241,7 +1241,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserEnable2faGoogleCancel() public function testUserEnable2faGoogleCancel()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/app'); $crawler = $client->request('GET', '/config/otp/app');
@ -1271,7 +1271,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserDisable2faGoogle() public function testUserDisable2faGoogle()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/app/disable'); $crawler = $client->request('GET', '/config/otp/app/disable');
@ -1295,7 +1295,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testExportTaggingRule() public function testExportTaggingRule()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
ob_start(); ob_start();
$crawler = $client->request('GET', '/tagging-rule/export'); $crawler = $client->request('GET', '/tagging-rule/export');
@ -1318,7 +1318,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testImportTagginfRuleBadFile() public function testImportTagginfRuleBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
$form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form();
@ -1335,7 +1335,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testImportTagginfRuleFile() public function testImportTagginfRuleFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
$form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form();

View file

@ -39,7 +39,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testLogin() public function testLogin()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/new'); $client->request('GET', '/new');
@ -53,7 +53,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testQuickstart() public function testQuickstart()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/unread/list'); $client->request('GET', '/unread/list');
$this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertSame(302, $client->getResponse()->getStatusCode());
@ -86,7 +86,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testGetNew() public function testGetNew()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -102,7 +102,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewViaBookmarklet() public function testPostNewViaBookmarklet()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/'); $crawler = $client->request('GET', '/');
@ -127,7 +127,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewEmpty() public function testPostNewEmpty()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -148,7 +148,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOk() public function testPostNewOk()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('store_article_headers', 1); $client->getContainer()->get(Config::class)->set('store_article_headers', 1);
@ -187,7 +187,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOkWithTaggingRules() public function testPostNewOkWithTaggingRules()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -224,7 +224,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{ {
$url = 'https://www.liberation.fr/planete/2017/04/05/donald-trump-et-xi-jinping-tentative-de-flirt-en-floride_1560768'; $url = 'https://www.liberation.fr/planete/2017/04/05/donald-trump-et-xi-jinping-tentative-de-flirt-en-floride_1560768';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -262,7 +262,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->persist($entry); $this->getEntityManager()->persist($entry);
$this->getEntityManager()->flush(); $this->getEntityManager()->flush();
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -286,7 +286,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOkUrlExistWithAccent() public function testPostNewOkUrlExistWithAccent()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$url = 'https://www.aritylabs.com/post/106091708292/des-contr%C3%B4leurs-optionnels-gr%C3%A2ce-%C3%A0-constmissing'; $url = 'https://www.aritylabs.com/post/106091708292/des-contr%C3%B4leurs-optionnels-gr%C3%A2ce-%C3%A0-constmissing';
@ -324,7 +324,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOkUrlExistWithRedirection() public function testPostNewOkUrlExistWithRedirection()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$url = 'https://wllbg.org/test-redirect/c51c'; $url = 'https://wllbg.org/test-redirect/c51c';
@ -362,7 +362,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewThatWillBeTagged() public function testPostNewThatWillBeTagged()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -426,7 +426,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testArchive() public function testArchive()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/archive/list'); $client->request('GET', '/archive/list');
@ -436,7 +436,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testUntagged() public function testUntagged()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/untagged/list'); $client->request('GET', '/untagged/list');
@ -446,7 +446,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testStarred() public function testStarred()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/starred/list'); $client->request('GET', '/starred/list');
@ -456,7 +456,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testWithAnnotations() public function testWithAnnotations()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/annotated/list'); $crawler = $client->request('GET', '/annotated/list');
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());
@ -466,7 +466,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRangeException() public function testRangeException()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/all/list/900'); $client->request('GET', '/all/list/900');
@ -477,7 +477,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testView() public function testView()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://example.com/foo'); $entry->setUrl('http://example.com/foo');
@ -499,7 +499,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testReload() public function testReload()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -523,7 +523,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testReloadWithFetchingFailed() public function testReloadWithFetchingFailed()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/failed.html'); $entry->setUrl('http://0.0.0.0/failed.html');
@ -547,7 +547,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEdit() public function testEdit()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -565,7 +565,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEditUpdate() public function testEditUpdate()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -598,7 +598,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEditRemoveOriginUrl() public function testEditRemoveOriginUrl()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -634,7 +634,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testToggleArchive() public function testToggleArchive()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -657,7 +657,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testToggleStar() public function testToggleStar()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -680,7 +680,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testDelete() public function testDelete()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -706,7 +706,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testViewAndDelete() public function testViewAndDelete()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer() $em = $client->getContainer()
->get(EntityManagerInterface::class); ->get(EntityManagerInterface::class);
@ -742,7 +742,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testViewOtherUserEntry() public function testViewOtherUserEntry()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$content = $client->getContainer() $content = $client->getContainer()
->get(EntityManagerInterface::class) ->get(EntityManagerInterface::class)
@ -757,7 +757,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTime() public function testFilterOnReadingTime()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
$entry->setReadingTime(22); $entry->setReadingTime(22);
@ -781,7 +781,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTimeWithNegativeValue() public function testFilterOnReadingTimeWithNegativeValue()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
@ -801,7 +801,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTimeOnlyUpper() public function testFilterOnReadingTimeOnlyUpper()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/all/list'); $crawler = $client->request('GET', '/all/list');
$this->assertCount(5, $crawler->filter($this->entryDataTestAttribute)); $this->assertCount(5, $crawler->filter($this->entryDataTestAttribute));
@ -829,7 +829,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTimeOnlyLower() public function testFilterOnReadingTimeOnlyLower()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
@ -856,7 +856,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnUnreadStatus() public function testFilterOnUnreadStatus()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/all/list'); $crawler = $client->request('GET', '/all/list');
@ -884,7 +884,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnCreationDate() public function testFilterOnCreationDate()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $this->getEntityManager(); $em = $this->getEntityManager();
@ -933,7 +933,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnAnnotatedStatus() public function testFilterOnAnnotatedStatus()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/all/list'); $crawler = $client->request('GET', '/all/list');
@ -950,7 +950,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
$em = $this->getClient()->getContainer()->get(EntityManagerInterface::class); $em = $this->getTestClient()->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
->findOneByUserName('admin'); ->findOneByUserName('admin');
@ -971,7 +971,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPaginationWithFilter() public function testPaginationWithFilter()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
$form = $crawler->filter('button[id=config_save]')->form(); $form = $crawler->filter('button[id=config_save]')->form();
@ -1000,7 +1000,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnDomainName() public function testFilterOnDomainName()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
@ -1032,7 +1032,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnStatus() public function testFilterOnStatus()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
@ -1054,7 +1054,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterPreselectedStatus() public function testFilterPreselectedStatus()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
@ -1078,7 +1078,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnIsPublic() public function testFilterOnIsPublic()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
@ -1091,7 +1091,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPreviewPictureFilter() public function testPreviewPictureFilter()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
@ -1104,7 +1104,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnLanguage() public function testFilterOnLanguage()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -1133,7 +1133,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testShareEntryPublicly() public function testShareEntryPublicly()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// sharing is enabled // sharing is enabled
$client->getContainer()->get(Config::class)->set('share_public', 1); $client->getContainer()->get(Config::class)->set('share_public', 1);
@ -1159,11 +1159,12 @@ class EntryControllerTest extends WallabagCoreTestCase
$client->request('GET', $shareUrl); $client->request('GET', $shareUrl);
// @TODO: understand why public & max-age are override after the response is return in the controller
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertStringContainsString('max-age=25200', $client->getResponse()->headers->get('cache-control')); // $this->assertStringContainsString('max-age=25200', $client->getResponse()->headers->get('cache-control'));
$this->assertStringContainsString('public', $client->getResponse()->headers->get('cache-control')); // $this->assertStringContainsString('public', $client->getResponse()->headers->get('cache-control'));
$this->assertStringContainsString('s-maxage=25200', $client->getResponse()->headers->get('cache-control')); $this->assertStringContainsString('s-maxage=25200', $client->getResponse()->headers->get('cache-control'));
$this->assertStringNotContainsString('no-cache', $client->getResponse()->headers->get('cache-control')); // $this->assertStringNotContainsString('no-cache', $client->getResponse()->headers->get('cache-control'));
$this->assertStringContainsString('og:title', $client->getResponse()->getContent()); $this->assertStringContainsString('og:title', $client->getResponse()->getContent());
$this->assertStringContainsString('og:type', $client->getResponse()->getContent()); $this->assertStringContainsString('og:type', $client->getResponse()->getContent());
$this->assertStringContainsString('og:url', $client->getResponse()->getContent()); $this->assertStringContainsString('og:url', $client->getResponse()->getContent());
@ -1190,7 +1191,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{ {
$this->downloadImagesEnabled = true; $this->downloadImagesEnabled = true;
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$url = self::AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE; $url = self::AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE;
$client->getContainer()->get(Config::class)->set('download_images_enabled', 1); $client->getContainer()->get(Config::class)->set('download_images_enabled', 1);
@ -1232,7 +1233,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{ {
$this->downloadImagesEnabled = true; $this->downloadImagesEnabled = true;
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$url = self::AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE; $url = self::AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE;
$client->getContainer()->get(Config::class)->set('download_images_enabled', 1); $client->getContainer()->get(Config::class)->set('download_images_enabled', 1);
@ -1266,7 +1267,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRedirectToHomepage() public function testRedirectToHomepage()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
// Redirect to homepage // Redirect to homepage
$config = $this->getLoggedInUser()->getConfig(); $config = $this->getLoggedInUser()->getConfig();
@ -1289,7 +1290,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRedirectToCurrentPage() public function testRedirectToCurrentPage()
{ {
$this->logInAs('empty'); $this->logInAs('empty');
$client = $this->getClient(); $client = $this->getTestClient();
// Redirect to current page // Redirect to current page
$config = $this->getLoggedInUser()->getConfig(); $config = $this->getLoggedInUser()->getConfig();
@ -1312,7 +1313,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnHttpStatus() public function testFilterOnHttpStatus()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('https://www.lemonde.fr/incorrect-url/'); $entry->setUrl('https://www.lemonde.fr/incorrect-url/');
@ -1370,7 +1371,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testSearch() public function testSearch()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url); $entry->setUrl($this->url);
@ -1514,7 +1515,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testLanguageValidation($url, $expectedLanguage) public function testLanguageValidation($url, $expectedLanguage)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/new'); $crawler = $client->request('GET', '/new');
@ -1547,7 +1548,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{ {
$url = 'https://www.monde-diplomatique.fr/2017/05/BONNET/57476'; $url = 'https://www.monde-diplomatique.fr/2017/05/BONNET/57476';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
// enable restricted access // enable restricted access
@ -1596,7 +1597,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{ {
$url = 'http://example.com/papers/email_tracking.pdf'; $url = 'http://example.com/papers/email_tracking.pdf';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$container = $client->getContainer(); $container = $client->getContainer();
$contentProxy = $this->getMockBuilder(ContentProxy::class) $contentProxy = $this->getMockBuilder(ContentProxy::class)
@ -1643,7 +1644,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEntryDeleteTagLink() public function testEntryDeleteTagLink()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$entry = $em->getRepository(Entry::class)->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId()); $entry = $em->getRepository(Entry::class)->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
@ -1662,7 +1663,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRandom() public function testRandom()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/unread/random'); $client->request('GET', '/unread/random');
$this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertSame(302, $client->getResponse()->getStatusCode());
@ -1692,7 +1693,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testMass() public function testMass()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry1 = new Entry($this->getLoggedInUser()); $entry1 = new Entry($this->getLoggedInUser());
$entry1->setUrl($this->url); $entry1->setUrl($this->url);
@ -1803,7 +1804,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testGetSameDomainEntries() public function testGetSameDomainEntries()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/domain/1'); $crawler = $client->request('GET', '/domain/1');
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());

View file

@ -13,7 +13,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testLogin() public function testLogin()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/export/unread.csv'); $client->request('GET', '/export/unread.csv');
@ -24,7 +24,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testUnknownCategoryExport() public function testUnknownCategoryExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/export/awesomeness.epub'); $client->request('GET', '/export/awesomeness.epub');
@ -34,7 +34,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testUnknownFormatExport() public function testUnknownFormatExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/export/unread.xslx'); $client->request('GET', '/export/unread.xslx');
@ -44,7 +44,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testUnsupportedFormatExport() public function testUnsupportedFormatExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/export/unread.doc'); $client->request('GET', '/export/unread.doc');
$this->assertSame(404, $client->getResponse()->getStatusCode()); $this->assertSame(404, $client->getResponse()->getStatusCode());
@ -61,7 +61,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testBadEntryId() public function testBadEntryId()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/export/0.mobi'); $client->request('GET', '/export/0.mobi');
@ -71,7 +71,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testEpubExport() public function testEpubExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
ob_start(); ob_start();
$crawler = $client->request('GET', '/export/archive.epub'); $crawler = $client->request('GET', '/export/archive.epub');
@ -88,7 +88,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testMobiExport() public function testMobiExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$content = $client->getContainer() $content = $client->getContainer()
->get(EntityManagerInterface::class) ->get(EntityManagerInterface::class)
@ -110,7 +110,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testPdfExport() public function testPdfExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
ob_start(); ob_start();
$crawler = $client->request('GET', '/export/all.pdf'); $crawler = $client->request('GET', '/export/all.pdf');
@ -138,7 +138,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testTxtExport() public function testTxtExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
ob_start(); ob_start();
$crawler = $client->request('GET', '/export/all.txt'); $crawler = $client->request('GET', '/export/all.txt');
@ -155,7 +155,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testCsvExport() public function testCsvExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// to be sure results are the same // to be sure results are the same
$contentInDB = $client->getContainer() $contentInDB = $client->getContainer()
@ -202,7 +202,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testJsonExport() public function testJsonExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$contentInDB = $client->getContainer() $contentInDB = $client->getContainer()
->get(EntityManagerInterface::class) ->get(EntityManagerInterface::class)
@ -253,7 +253,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$this->setUpForJsonExportFromSearch(); $this->setUpForJsonExportFromSearch();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
ob_start(); ob_start();
$crawler = $client->request('GET', '/export/search.json?search_entry[term]=entry+search&currentRoute=homepage'); $crawler = $client->request('GET', '/export/search.json?search_entry[term]=entry+search&currentRoute=homepage');
@ -275,7 +275,7 @@ class ExportControllerTest extends WallabagCoreTestCase
public function testXmlExport() public function testXmlExport()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// to be sure results are the same // to be sure results are the same
$contentInDB = $client->getContainer() $contentInDB = $client->getContainer()
@ -313,7 +313,7 @@ class ExportControllerTest extends WallabagCoreTestCase
private function setUpForJsonExportFromSearch() private function setUpForJsonExportFromSearch()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $this->getEntityManager(); $em = $this->getEntityManager();
$userRepository = $client->getContainer() $userRepository = $client->getContainer()

View file

@ -82,7 +82,7 @@ class FeedControllerTest extends WallabagCoreTestCase
*/ */
public function testBadUrl($url) public function testBadUrl($url)
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', $url); $client->request('GET', $url);
@ -91,7 +91,7 @@ class FeedControllerTest extends WallabagCoreTestCase
public function testUnread() public function testUnread()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
@ -112,7 +112,7 @@ class FeedControllerTest extends WallabagCoreTestCase
public function testStarred() public function testStarred()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
@ -124,7 +124,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$em->persist($config); $em->persist($config);
$em->flush(); $em->flush();
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/feed/admin/SUPERTOKEN/starred'); $client->request('GET', '/feed/admin/SUPERTOKEN/starred');
$this->assertSame(200, $client->getResponse()->getStatusCode(), 1); $this->assertSame(200, $client->getResponse()->getStatusCode(), 1);
@ -134,7 +134,7 @@ class FeedControllerTest extends WallabagCoreTestCase
public function testArchives() public function testArchives()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
@ -146,7 +146,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$em->persist($config); $em->persist($config);
$em->flush(); $em->flush();
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/feed/admin/SUPERTOKEN/archive'); $client->request('GET', '/feed/admin/SUPERTOKEN/archive');
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());
@ -156,7 +156,7 @@ class FeedControllerTest extends WallabagCoreTestCase
public function testAll() public function testAll()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
@ -168,7 +168,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$em->persist($config); $em->persist($config);
$em->flush(); $em->flush();
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/feed/admin/SUPERTOKEN/all'); $client->request('GET', '/feed/admin/SUPERTOKEN/all');
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());
@ -178,7 +178,7 @@ class FeedControllerTest extends WallabagCoreTestCase
public function testPagination() public function testPagination()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
@ -190,7 +190,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$em->persist($config); $em->persist($config);
$em->flush(); $em->flush();
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/feed/admin/SUPERTOKEN/unread'); $client->request('GET', '/feed/admin/SUPERTOKEN/unread');
$this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertSame(200, $client->getResponse()->getStatusCode());
@ -206,7 +206,7 @@ class FeedControllerTest extends WallabagCoreTestCase
public function testTags() public function testTags()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class); $em = $client->getContainer()->get(EntityManagerInterface::class);
$user = $em $user = $em
->getRepository(User::class) ->getRepository(User::class)
@ -247,7 +247,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$em->flush(); $em->flush();
$client = $this->getClient(); $client = $this->getTestClient();
// tag foo - without sort // tag foo - without sort
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo'); $crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo');
@ -302,7 +302,7 @@ class FeedControllerTest extends WallabagCoreTestCase
*/ */
public function testRedirectFromRssToAtom($url) public function testRedirectFromRssToAtom($url)
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', $url); $client->request('GET', $url);

View file

@ -9,7 +9,7 @@ class IgnoreOriginInstanceRuleControllerTest extends WallabagCoreTestCase
public function testListIgnoreOriginInstanceRule() public function testListIgnoreOriginInstanceRule()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/ignore-origin-instance-rules/'); $crawler = $client->request('GET', '/ignore-origin-instance-rules/');
@ -24,7 +24,7 @@ class IgnoreOriginInstanceRuleControllerTest extends WallabagCoreTestCase
public function testIgnoreOriginInstanceRuleCreationEditionDeletion() public function testIgnoreOriginInstanceRuleCreationEditionDeletion()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// Creation // Creation
$crawler = $client->request('GET', '/ignore-origin-instance-rules/new'); $crawler = $client->request('GET', '/ignore-origin-instance-rules/new');
@ -127,7 +127,7 @@ class IgnoreOriginInstanceRuleControllerTest extends WallabagCoreTestCase
public function testIgnoreOriginInstanceRuleCreationFail($data, $messages) public function testIgnoreOriginInstanceRuleCreationFail($data, $messages)
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/ignore-origin-instance-rules/new'); $crawler = $client->request('GET', '/ignore-origin-instance-rules/new');

View file

@ -11,7 +11,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
public function testLoginWithEmail() public function testLoginWithEmail()
{ {
$this->logInAsUsingHttp('bigboss@wallabag.org'); $this->logInAsUsingHttp('bigboss@wallabag.org');
$client = $this->getClient(); $client = $this->getTestClient();
$client->followRedirects(); $client->followRedirects();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -21,7 +21,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
public function testLoginWithout2Factor() public function testLoginWithout2Factor()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->followRedirects(); $client->followRedirects();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
@ -30,7 +30,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
public function testLoginWith2FactorEmail() public function testLoginWith2FactorEmail()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
if (!$client->getContainer()->getParameter('twofactor_auth')) { if (!$client->getContainer()->getParameter('twofactor_auth')) {
$this->markTestSkipped('twofactor_auth is not enabled.'); $this->markTestSkipped('twofactor_auth is not enabled.');
@ -63,7 +63,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
public function testLoginWith2FactorGoogle() public function testLoginWith2FactorGoogle()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
if (!$client->getContainer()->getParameter('twofactor_auth')) { if (!$client->getContainer()->getParameter('twofactor_auth')) {
$this->markTestSkipped('twofactor_auth is not enabled.'); $this->markTestSkipped('twofactor_auth is not enabled.');
@ -96,7 +96,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
public function testEnabledRegistration() public function testEnabledRegistration()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
if (!$client->getContainer()->getParameter('fosuser_registration')) { if (!$client->getContainer()->getParameter('fosuser_registration')) {
$this->markTestSkipped('fosuser_registration is not enabled.'); $this->markTestSkipped('fosuser_registration is not enabled.');

View file

@ -13,7 +13,7 @@ class SettingsControllerTest extends WallabagCoreTestCase
public function testSettingsWithAdmin() public function testSettingsWithAdmin()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/settings'); $crawler = $client->request('GET', '/settings');
@ -23,7 +23,7 @@ class SettingsControllerTest extends WallabagCoreTestCase
public function testSettingsWithNormalUser() public function testSettingsWithNormalUser()
{ {
$this->logInAs('bob'); $this->logInAs('bob');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/settings'); $crawler = $client->request('GET', '/settings');

View file

@ -13,7 +13,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
public function testAccessDeniedBecauseFeatureDisabled() public function testAccessDeniedBecauseFeatureDisabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('restricted_access', 0); $client->getContainer()->get(Config::class)->set('restricted_access', 0);
@ -27,7 +27,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
public function testListSiteCredential() public function testListSiteCredential()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/site-credentials/'); $crawler = $client->request('GET', '/site-credentials/');
@ -42,7 +42,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
public function testNewSiteCredential() public function testNewSiteCredential()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/site-credentials/new'); $crawler = $client->request('GET', '/site-credentials/new');
@ -73,7 +73,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
public function testEditSiteCredential() public function testEditSiteCredential()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$credential = $this->createSiteCredential($client); $credential = $this->createSiteCredential($client);
@ -106,7 +106,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
public function testEditFromADifferentUserSiteCredential() public function testEditFromADifferentUserSiteCredential()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$credential = $this->createSiteCredential($client); $credential = $this->createSiteCredential($client);
@ -120,7 +120,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
public function testDeleteSiteCredential() public function testDeleteSiteCredential()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$credential = $this->createSiteCredential($client); $credential = $this->createSiteCredential($client);

View file

@ -9,7 +9,7 @@ class StaticControllerTest extends WallabagCoreTestCase
public function testAbout() public function testAbout()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/about'); $client->request('GET', '/about');
@ -19,7 +19,7 @@ class StaticControllerTest extends WallabagCoreTestCase
public function testHowto() public function testHowto()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/howto'); $client->request('GET', '/howto');

View file

@ -19,7 +19,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testList() public function testList()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/tag/list'); $client->request('GET', '/tag/list');
@ -29,7 +29,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testAddTagToEntry() public function testAddTagToEntry()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/foo'); $entry->setUrl('http://0.0.0.0/foo');
@ -75,7 +75,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testAddMultipleTagToEntry() public function testAddMultipleTagToEntry()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = $client->getContainer() $entry = $client->getContainer()
->get(EntityManagerInterface::class) ->get(EntityManagerInterface::class)
@ -111,7 +111,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testRemoveTagFromEntry() public function testRemoveTagFromEntry()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$tag = new Tag(); $tag = new Tag();
$tag->setLabel($this->tagName); $tag->setLabel($this->tagName);
@ -149,7 +149,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testRemoveTag() public function testRemoveTag()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$tag = new Tag(); $tag = new Tag();
$tag->setLabel($this->tagName); $tag->setLabel($this->tagName);
@ -198,7 +198,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testShowEntriesForTagAction() public function testShowEntriesForTagAction()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$em = $client->getContainer() $em = $client->getContainer()
->get(EntityManagerInterface::class); ->get(EntityManagerInterface::class);
@ -236,7 +236,7 @@ class TagControllerTest extends WallabagCoreTestCase
$newTagLabel = 'rename label'; $newTagLabel = 'rename label';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$tag = new Tag(); $tag = new Tag();
$tag->setLabel($this->tagName); $tag->setLabel($this->tagName);
@ -308,7 +308,7 @@ class TagControllerTest extends WallabagCoreTestCase
{ {
$tagLabel = 'same label'; $tagLabel = 'same label';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$tag = new Tag(); $tag = new Tag();
$tag->setLabel($tagLabel); $tag->setLabel($tagLabel);
@ -363,7 +363,7 @@ class TagControllerTest extends WallabagCoreTestCase
$tagLabel = 'same label'; $tagLabel = 'same label';
$newTagLabel = 'saMe labEl'; $newTagLabel = 'saMe labEl';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$tag = new Tag(); $tag = new Tag();
$tag->setLabel($tagLabel); $tag->setLabel($tagLabel);
@ -425,7 +425,7 @@ class TagControllerTest extends WallabagCoreTestCase
$tagLabel = 'existing label'; $tagLabel = 'existing label';
$previousTagLabel = 'previous label'; $previousTagLabel = 'previous label';
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$tag = new Tag(); $tag = new Tag();
$tag->setLabel($tagLabel); $tag->setLabel($tagLabel);
@ -488,7 +488,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testAddUnicodeTagLabel() public function testAddUnicodeTagLabel()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser()); $entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/tag-caché'); $entry->setUrl('http://0.0.0.0/tag-caché');
@ -534,7 +534,7 @@ class TagControllerTest extends WallabagCoreTestCase
public function testAssignTagsOnSearchResults() public function testAssignTagsOnSearchResults()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// Search on unread list // Search on unread list
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');

View file

@ -303,7 +303,7 @@ class GrabySiteConfigBuilderTest extends WallabagCoreTestCase
$builder = new GrabySiteConfigBuilder( $builder = new GrabySiteConfigBuilder(
$grabyConfigBuilderMock, $grabyConfigBuilderMock,
$tokenStorage, $tokenStorage,
$this->getClient()->getContainer()->get(SiteCredentialRepository::class), $this->getTestClient()->getContainer()->get(SiteCredentialRepository::class),
$logger $logger
); );

View file

@ -32,7 +32,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
return $this->client = static::createClient(); return $this->client = static::createClient();
} }
public function getClient() public function getTestClient()
{ {
return $this->client; return $this->client;
} }

View file

@ -16,7 +16,7 @@ class ImportCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class); $this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments'); $this->expectExceptionMessage('Not enough arguments');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import'); $command = $application->find('wallabag:import');
@ -29,7 +29,7 @@ class ImportCommandTest extends WallabagCoreTestCase
$this->expectException(Exception::class); $this->expectException(Exception::class);
$this->expectExceptionMessage('not found'); $this->expectExceptionMessage('not found');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import'); $command = $application->find('wallabag:import');
@ -44,7 +44,7 @@ class ImportCommandTest extends WallabagCoreTestCase
{ {
$this->expectException(NoResultException::class); $this->expectException(NoResultException::class);
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import'); $command = $application->find('wallabag:import');
@ -57,7 +57,7 @@ class ImportCommandTest extends WallabagCoreTestCase
public function testRunImportCommand() public function testRunImportCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import'); $command = $application->find('wallabag:import');
@ -76,7 +76,7 @@ class ImportCommandTest extends WallabagCoreTestCase
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import'); $command = $application->find('wallabag:import');

View file

@ -17,7 +17,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class); $this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments (missing: "serviceName")'); $this->expectExceptionMessage('Not enough arguments (missing: "serviceName")');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import:redis-worker'); $command = $application->find('wallabag:import:redis-worker');
@ -30,7 +30,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
$this->expectException(Exception::class); $this->expectException(Exception::class);
$this->expectExceptionMessage('No queue or consumer found for service name'); $this->expectExceptionMessage('No queue or consumer found for service name');
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:import:redis-worker'); $command = $application->find('wallabag:import:redis-worker');
@ -42,7 +42,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
public function testRunRedisWorkerCommand() public function testRunRedisWorkerCommand()
{ {
$application = new Application($this->getClient()->getKernel()); $application = new Application($this->getTestClient()->getKernel());
$factory = new RedisMockFactory(); $factory = new RedisMockFactory();
$redisMock = $factory->getAdapter(Client::class, true); $redisMock = $factory->getAdapter(Client::class, true);

View file

@ -14,7 +14,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChrome() public function testImportChrome()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome'); $crawler = $client->request('GET', '/import/chrome');
@ -26,7 +26,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChromeWithRabbitEnabled() public function testImportChromeWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChromeBadFile() public function testImportChromeBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome'); $crawler = $client->request('GET', '/import/chrome');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/chrome'); $crawler = $client->request('GET', '/import/chrome');
@ -94,7 +94,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithChromeFile() public function testImportWallabagWithChromeFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome'); $crawler = $client->request('GET', '/import/chrome');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -135,7 +135,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile() public function testImportWallabagWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome'); $crawler = $client->request('GET', '/import/chrome');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -14,7 +14,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDelicious() public function testImportDelicious()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious'); $crawler = $client->request('GET', '/import/delicious');
@ -26,7 +26,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithRabbitEnabled() public function testImportDeliciousWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousBadFile() public function testImportDeliciousBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious'); $crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/delicious'); $crawler = $client->request('GET', '/import/delicious');
@ -94,7 +94,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithFile() public function testImportDeliciousWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious'); $crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -135,7 +135,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithFileAndMarkAllAsRead() public function testImportDeliciousWithFileAndMarkAllAsRead()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious'); $crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -180,7 +180,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithEmptyFile() public function testImportDeliciousWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious'); $crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -14,7 +14,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcurator() public function testImportElcurator()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/elcurator'); $crawler = $client->request('GET', '/import/elcurator');
@ -26,7 +26,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcuratorWithRabbitEnabled() public function testImportElcuratorWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcuratorBadFile() public function testImportElcuratorBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/elcurator'); $crawler = $client->request('GET', '/import/elcurator');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -95,7 +95,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcuratorWithFile() public function testImportElcuratorWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/elcurator'); $crawler = $client->request('GET', '/import/elcurator');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -14,7 +14,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportFirefox() public function testImportFirefox()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox'); $crawler = $client->request('GET', '/import/firefox');
@ -26,7 +26,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportFirefoxWithRabbitEnabled() public function testImportFirefoxWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportFirefoxBadFile() public function testImportFirefoxBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox'); $crawler = $client->request('GET', '/import/firefox');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/firefox'); $crawler = $client->request('GET', '/import/firefox');
@ -94,7 +94,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFirefoxFile() public function testImportWallabagWithFirefoxFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox'); $crawler = $client->request('GET', '/import/firefox');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -149,7 +149,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile() public function testImportWallabagWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox'); $crawler = $client->request('GET', '/import/firefox');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -8,7 +8,7 @@ class ImportControllerTest extends WallabagCoreTestCase
{ {
public function testLogin() public function testLogin()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/import/'); $client->request('GET', '/import/');
@ -19,7 +19,7 @@ class ImportControllerTest extends WallabagCoreTestCase
public function testImportList() public function testImportList()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/'); $crawler = $client->request('GET', '/import/');

View file

@ -14,7 +14,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaper() public function testImportInstapaper()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper'); $crawler = $client->request('GET', '/import/instapaper');
@ -26,7 +26,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithRabbitEnabled() public function testImportInstapaperWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperBadFile() public function testImportInstapaperBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper'); $crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/instapaper'); $crawler = $client->request('GET', '/import/instapaper');
@ -94,7 +94,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithFile() public function testImportInstapaperWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper'); $crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -148,7 +148,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithFileAndMarkAllAsRead() public function testImportInstapaperWithFileAndMarkAllAsRead()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper'); $crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -193,7 +193,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithEmptyFile() public function testImportInstapaperWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper'); $crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -14,7 +14,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboard() public function testImportPinboard()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard'); $crawler = $client->request('GET', '/import/pinboard');
@ -26,7 +26,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithRabbitEnabled() public function testImportPinboardWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardBadFile() public function testImportPinboardBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard'); $crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/pinboard'); $crawler = $client->request('GET', '/import/pinboard');
@ -94,7 +94,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithFile() public function testImportPinboardWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard'); $crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -140,7 +140,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithFileAndMarkAllAsRead() public function testImportPinboardWithFileAndMarkAllAsRead()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard'); $crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -187,7 +187,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithEmptyFile() public function testImportPinboardWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard'); $crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -12,7 +12,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocket() public function testImportPocket()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pocket'); $crawler = $client->request('GET', '/import/pocket');
@ -23,7 +23,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketWithRabbitEnabled() public function testImportPocketWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -39,7 +39,7 @@ class PocketControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -54,7 +54,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketAuthBadToken() public function testImportPocketAuthBadToken()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/import/pocket/auth'); $client->request('GET', '/import/pocket/auth');
@ -64,7 +64,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketAuth() public function testImportPocketAuth()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$pocketImport = $this->getMockBuilder(PocketImport::class) $pocketImport = $this->getMockBuilder(PocketImport::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -86,7 +86,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketCallbackWithBadToken() public function testImportPocketCallbackWithBadToken()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$pocketImport = $this->getMockBuilder(PocketImport::class) $pocketImport = $this->getMockBuilder(PocketImport::class)
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -109,7 +109,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketCallback() public function testImportPocketCallback()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$pocketImport = $this->getMockBuilder(PocketImport::class) $pocketImport = $this->getMockBuilder(PocketImport::class)
->disableOriginalConstructor() ->disableOriginalConstructor()

View file

@ -14,7 +14,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadability() public function testImportReadability()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability'); $crawler = $client->request('GET', '/import/readability');
@ -26,7 +26,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithRabbitEnabled() public function testImportReadabilityWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityBadFile() public function testImportReadabilityBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability'); $crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/readability'); $crawler = $client->request('GET', '/import/readability');
@ -94,7 +94,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithFile() public function testImportReadabilityWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability'); $crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -138,7 +138,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithFileAndMarkAllAsRead() public function testImportReadabilityWithFileAndMarkAllAsRead()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability'); $crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -185,7 +185,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithEmptyFile() public function testImportReadabilityWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability'); $crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -14,7 +14,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabag() public function testImportWallabag()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1'); $crawler = $client->request('GET', '/import/wallabag-v1');
@ -26,7 +26,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithRabbitEnabled() public function testImportWallabagWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagBadFile() public function testImportWallabagBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1'); $crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -95,7 +95,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFile() public function testImportWallabagWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1'); $crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -139,7 +139,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFileAndMarkAllAsRead() public function testImportWallabagWithFileAndMarkAllAsRead()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1'); $crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -186,7 +186,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile() public function testImportWallabagWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1'); $crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -14,7 +14,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabag() public function testImportWallabag()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2'); $crawler = $client->request('GET', '/import/wallabag-v2');
@ -26,7 +26,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithRabbitEnabled() public function testImportWallabagWithRabbitEnabled()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1); $client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagBadFile() public function testImportWallabagBadFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2'); $crawler = $client->request('GET', '/import/wallabag-v2');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
{ {
$this->checkRedis(); $this->checkRedis();
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1); $client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -95,7 +95,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFile() public function testImportWallabagWithFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2'); $crawler = $client->request('GET', '/import/wallabag-v2');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -161,7 +161,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile() public function testImportWallabagWithEmptyFile()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2'); $crawler = $client->request('GET', '/import/wallabag-v2');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();

View file

@ -8,7 +8,7 @@ class ManageControllerTest extends WallabagCoreTestCase
{ {
public function testLogin() public function testLogin()
{ {
$client = $this->getClient(); $client = $this->getTestClient();
$client->request('GET', '/users/list'); $client->request('GET', '/users/list');
@ -19,7 +19,7 @@ class ManageControllerTest extends WallabagCoreTestCase
public function testCompleteScenario() public function testCompleteScenario()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// Create a new user in the database // Create a new user in the database
$crawler = $client->request('GET', '/users/list'); $crawler = $client->request('GET', '/users/list');
@ -71,7 +71,7 @@ class ManageControllerTest extends WallabagCoreTestCase
public function testDeleteDisabledForLoggedUser() public function testDeleteDisabledForLoggedUser()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
$crawler = $client->request('GET', '/users/' . $this->getLoggedInUserId() . '/edit'); $crawler = $client->request('GET', '/users/' . $this->getLoggedInUserId() . '/edit');
$disabled = $crawler->selectButton('user.form.delete')->extract('disabled'); $disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
@ -82,7 +82,7 @@ class ManageControllerTest extends WallabagCoreTestCase
public function testUserSearch() public function testUserSearch()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
$client = $this->getClient(); $client = $this->getTestClient();
// Search on unread list // Search on unread list
$crawler = $client->request('GET', '/users/list'); $crawler = $client->request('GET', '/users/list');

View file

@ -64,6 +64,6 @@ class AuthenticationFailureListenerTest extends TestCase
$records = $this->logHandler->getRecords(); $records = $this->logHandler->getRecords();
$this->assertCount(1, $records); $this->assertCount(1, $records);
$this->assertSame('Authentication failure for user "admin", from IP "127.0.0.1", with UA: "Symfony/3.X".', $records[0]['message']); $this->assertSame('Authentication failure for user "admin", from IP "127.0.0.1", with UA: "Symfony".', $records[0]['message']);
} }
} }