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\:
resource: '../../src/Wallabag/CoreBundle/*'
exclude: '../../src/Wallabag/CoreBundle/{Controller,Entity}'
exclude: ['../../src/Wallabag/CoreBundle/{Controller,Entity}', '../../src/Wallabag/CoreBundle/Event/*Event.php']
Wallabag\ImportBundle\:
resource: '../../src/Wallabag/ImportBundle/*'

View file

@ -107,10 +107,10 @@
"sentry/sentry-symfony": "3.5.3",
"stof/doctrine-extensions-bundle": "^1.2",
"swiftmailer/swiftmailer": "^6.3",
"symfony/dom-crawler": "^3.4",
"symfony/dom-crawler": "^4.0",
"symfony/monolog-bundle": "^3.1",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/symfony": "3.4.*",
"symfony/symfony": "^4.0",
"tecnickcom/tcpdf": "^6.3.0",
"twig/extensions": "^1.5",
"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
symfony:
container_xml_path: %rootDir%/../../../var/cache/test/appTestDebugProjectContainer.xml
container_xml_path: %rootDir%/../../../var/cache/test/appAppKernelTestDebugContainer.xml
bootstrapFiles:
- vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php
inferPrivatePropertyTypeFromConstructor: true
ignoreErrors:
- '#^Service ".+" is private\.?#'

View file

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

View file

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

View file

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

View file

@ -372,7 +372,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
foreach (['self', 'first', 'last'] as $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'));

View file

@ -13,7 +13,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
{
public function testRunCleanDuplicates()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates');
@ -26,7 +26,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testRunCleanDuplicatesCommandWithBadUsername()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates');
@ -40,7 +40,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testRunCleanDuplicatesCommandForUser()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates');
@ -55,7 +55,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
public function testDuplicate()
{
$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);
$this->logInAs('admin');
@ -79,7 +79,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
$nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertCount(2, $nbEntries);
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:clean-duplicates');

View file

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

View file

@ -13,7 +13,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
{
public function testRunGenerateUrlHashesCommand()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls');
@ -26,7 +26,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
public function testRunGenerateUrlHashesCommandWithBadUsername()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls');
@ -40,7 +40,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
public function testRunGenerateUrlHashesCommandForUser()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls');
@ -55,7 +55,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
public function testGenerateUrls()
{
$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);
$this->logInAs('admin');
@ -68,7 +68,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
$em->persist($entry1);
$em->flush();
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:generate-hashed-urls');

View file

@ -33,7 +33,7 @@ class InstallCommandTest extends WallabagCoreTestCase
parent::setUp();
/** @var Connection $connection */
$connection = $this->getClient()->getContainer()->get(ManagerRegistry::class)->getConnection();
$connection = $this->getTestClient()->getContainer()->get(ManagerRegistry::class)->getConnection();
if ($connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {
/*
* LOG: statement: CREATE DATABASE "wallabag"
@ -61,7 +61,7 @@ class InstallCommandTest extends WallabagCoreTestCase
parent::setUp();
}
$this->resetDatabase($this->getClient());
$this->resetDatabase($this->getTestClient());
}
protected function tearDown(): void
@ -84,7 +84,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommand()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */
$command = $application->find('wallabag:install');
@ -108,7 +108,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandWithReset()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */
$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,
// 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.');
}
$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
$command = $application->find('doctrine:database:drop');
@ -177,7 +177,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandChooseResetSchema()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */
$command = $application->find('wallabag:install');
@ -201,7 +201,7 @@ class InstallCommandTest extends WallabagCoreTestCase
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
$command = $application->find('doctrine:database:drop');
@ -209,7 +209,7 @@ class InstallCommandTest extends WallabagCoreTestCase
'--force' => true,
]), 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->run(new ArrayInput([]), new NullOutput());
@ -233,7 +233,7 @@ class InstallCommandTest extends WallabagCoreTestCase
public function testRunInstallCommandNoInteraction()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
/** @var InstallCommand $command */
$command = $application->find('wallabag:install');

View file

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

View file

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

View file

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

View file

@ -14,7 +14,7 @@ class TagAllCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class);
$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');
@ -24,7 +24,7 @@ class TagAllCommandTest extends WallabagCoreTestCase
public function testRunTagAllCommandWithBadUsername()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:tag:all');
@ -38,7 +38,7 @@ class TagAllCommandTest extends WallabagCoreTestCase
public function testRunTagAllCommand()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$command = $application->find('wallabag:tag:all');

View file

@ -20,7 +20,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
{
public function testLogin()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/new');
@ -31,7 +31,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testIndex()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -46,7 +46,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUpdate()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -73,7 +73,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeReadingSpeed()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/test-entry1')
@ -131,7 +131,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUpdateFailed($data)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -191,7 +191,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangePasswordFailed($data, $expectedMessage)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -210,7 +210,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangePassword()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -259,7 +259,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserFailed($data, $expectedMessage)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -278,7 +278,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserUpdate()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -304,7 +304,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testFeedUpdateResetToken()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
// reset the token
$em = $client->getContainer()->get(EntityManagerInterface::class);
@ -340,7 +340,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testGenerateTokenAjax()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request(
'GET',
@ -358,7 +358,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testRevokeTokenAjax()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request(
'GET',
@ -374,7 +374,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testFeedUpdate()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -402,7 +402,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
[
'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)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -438,7 +438,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testTaggingRuleCreation()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -525,7 +525,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testTaggingRuleCreationFail($data, $messages)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -547,7 +547,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testTaggingRuleTooLong()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -570,7 +570,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDeletingTaggingRuleFromAnOtherUser()
{
$this->logInAs('bob');
$client = $this->getClient();
$client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(TaggingRule::class)
@ -586,7 +586,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testEditingTaggingRuleFromAnOtherUser()
{
$this->logInAs('bob');
$client = $this->getClient();
$client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(TaggingRule::class)
@ -602,7 +602,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testIgnoreOriginRuleCreation()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -685,7 +685,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testIgnoreOriginRuleCreationFail($data, $messages)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -707,7 +707,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDeletingIgnoreOriginRuleFromAnOtherUser()
{
$this->logInAs('bob');
$client = $this->getClient();
$client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(IgnoreOriginUserRule::class)
@ -723,7 +723,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testEditingIgnoreOriginRuleFromAnOtherUser()
{
$this->logInAs('bob');
$client = $this->getClient();
$client = $this->getTestClient();
$rule = $client->getContainer()->get(EntityManagerInterface::class)
->getRepository(IgnoreOriginUserRule::class)
@ -739,7 +739,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDemoMode()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$config = $client->getContainer()->get(Config::class);
$config->set('demo_mode_enabled', 1);
@ -769,7 +769,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testDeleteUserButtonVisibility()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
@ -820,7 +820,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
*/
public function testDeleteAccount()
{
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
$user = new User();
@ -889,7 +889,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testReset()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
@ -976,7 +976,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testResetArchivedEntries()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
@ -1054,7 +1054,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testResetEntriesCascade()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
@ -1113,7 +1113,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testSwitchViewMode()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/unread/list');
@ -1131,7 +1131,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeLocaleWithoutReferer()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/locale/de');
$client->followRedirect();
@ -1142,7 +1142,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeLocaleWithReferer()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/login');
$client->request('GET', '/locale/de');
@ -1154,7 +1154,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testChangeLocaleToBadLocale()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/login');
$client->request('GET', '/locale/yuyuyuyu');
@ -1167,7 +1167,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserEnable2faEmail()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/email');
@ -1194,7 +1194,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserDisable2faEmail()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/email/disable');
@ -1217,7 +1217,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserEnable2faGoogle()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/app');
@ -1241,7 +1241,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserEnable2faGoogleCancel()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/app');
@ -1271,7 +1271,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testUserDisable2faGoogle()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config/otp/app/disable');
@ -1295,7 +1295,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testExportTaggingRule()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
ob_start();
$crawler = $client->request('GET', '/tagging-rule/export');
@ -1318,7 +1318,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testImportTagginfRuleBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
$form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form();
@ -1335,7 +1335,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
public function testImportTagginfRuleFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
$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()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/new');
@ -53,7 +53,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testQuickstart()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/unread/list');
$this->assertSame(302, $client->getResponse()->getStatusCode());
@ -86,7 +86,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testGetNew()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/new');
@ -102,7 +102,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewViaBookmarklet()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/');
@ -127,7 +127,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewEmpty()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/new');
@ -148,7 +148,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOk()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('store_article_headers', 1);
@ -187,7 +187,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOkWithTaggingRules()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
$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';
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/new');
@ -262,7 +262,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->persist($entry);
$this->getEntityManager()->flush();
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/new');
@ -286,7 +286,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOkUrlExistWithAccent()
{
$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';
@ -324,7 +324,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewOkUrlExistWithRedirection()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$url = 'https://wllbg.org/test-redirect/c51c';
@ -362,7 +362,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPostNewThatWillBeTagged()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/new');
@ -426,7 +426,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testArchive()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/archive/list');
@ -436,7 +436,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testUntagged()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/untagged/list');
@ -446,7 +446,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testStarred()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/starred/list');
@ -456,7 +456,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testWithAnnotations()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/annotated/list');
$this->assertSame(200, $client->getResponse()->getStatusCode());
@ -466,7 +466,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRangeException()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/all/list/900');
@ -477,7 +477,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testView()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://example.com/foo');
@ -499,7 +499,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testReload()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -523,7 +523,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testReloadWithFetchingFailed()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/failed.html');
@ -547,7 +547,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEdit()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -565,7 +565,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEditUpdate()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -598,7 +598,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEditRemoveOriginUrl()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -634,7 +634,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testToggleArchive()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -657,7 +657,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testToggleStar()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -680,7 +680,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testDelete()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -706,7 +706,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testViewAndDelete()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()
->get(EntityManagerInterface::class);
@ -742,7 +742,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testViewOtherUserEntry()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$content = $client->getContainer()
->get(EntityManagerInterface::class)
@ -757,7 +757,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTime()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
$entry->setReadingTime(22);
@ -781,7 +781,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTimeWithNegativeValue()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
@ -801,7 +801,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTimeOnlyUpper()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/all/list');
$this->assertCount(5, $crawler->filter($this->entryDataTestAttribute));
@ -829,7 +829,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnReadingTimeOnlyLower()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
@ -856,7 +856,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnUnreadStatus()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/all/list');
@ -884,7 +884,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnCreationDate()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $this->getEntityManager();
@ -933,7 +933,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnAnnotatedStatus()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/all/list');
@ -950,7 +950,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
$em = $this->getClient()->getContainer()->get(EntityManagerInterface::class);
$em = $this->getTestClient()->getContainer()->get(EntityManagerInterface::class);
$user = $em
->getRepository(User::class)
->findOneByUserName('admin');
@ -971,7 +971,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPaginationWithFilter()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/config');
$form = $crawler->filter('button[id=config_save]')->form();
@ -1000,7 +1000,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnDomainName()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
@ -1032,7 +1032,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnStatus()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
@ -1054,7 +1054,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterPreselectedStatus()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
@ -1078,7 +1078,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnIsPublic()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
@ -1091,7 +1091,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testPreviewPictureFilter()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
@ -1104,7 +1104,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnLanguage()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -1133,7 +1133,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testShareEntryPublicly()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
// sharing is enabled
$client->getContainer()->get(Config::class)->set('share_public', 1);
@ -1159,11 +1159,12 @@ class EntryControllerTest extends WallabagCoreTestCase
$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->assertStringContainsString('max-age=25200', $client->getResponse()->headers->get('cache-control'));
$this->assertStringContainsString('public', $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('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:type', $client->getResponse()->getContent());
$this->assertStringContainsString('og:url', $client->getResponse()->getContent());
@ -1190,7 +1191,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{
$this->downloadImagesEnabled = true;
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$url = self::AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE;
$client->getContainer()->get(Config::class)->set('download_images_enabled', 1);
@ -1232,7 +1233,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{
$this->downloadImagesEnabled = true;
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$url = self::AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE;
$client->getContainer()->get(Config::class)->set('download_images_enabled', 1);
@ -1266,7 +1267,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRedirectToHomepage()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
// Redirect to homepage
$config = $this->getLoggedInUser()->getConfig();
@ -1289,7 +1290,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testRedirectToCurrentPage()
{
$this->logInAs('empty');
$client = $this->getClient();
$client = $this->getTestClient();
// Redirect to current page
$config = $this->getLoggedInUser()->getConfig();
@ -1312,7 +1313,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testFilterOnHttpStatus()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('https://www.lemonde.fr/incorrect-url/');
@ -1370,7 +1371,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testSearch()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl($this->url);
@ -1514,7 +1515,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testLanguageValidation($url, $expectedLanguage)
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/new');
@ -1547,7 +1548,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{
$url = 'https://www.monde-diplomatique.fr/2017/05/BONNET/57476';
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
// enable restricted access
@ -1596,7 +1597,7 @@ class EntryControllerTest extends WallabagCoreTestCase
{
$url = 'http://example.com/papers/email_tracking.pdf';
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$container = $client->getContainer();
$contentProxy = $this->getMockBuilder(ContentProxy::class)
@ -1643,7 +1644,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testEntryDeleteTagLink()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$em = $client->getContainer()->get(EntityManagerInterface::class);
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/unread/random');
$this->assertSame(302, $client->getResponse()->getStatusCode());
@ -1692,7 +1693,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testMass()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$entry1 = new Entry($this->getLoggedInUser());
$entry1->setUrl($this->url);
@ -1803,7 +1804,7 @@ class EntryControllerTest extends WallabagCoreTestCase
public function testGetSameDomainEntries()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/domain/1');
$this->assertSame(200, $client->getResponse()->getStatusCode());

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -17,7 +17,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
$this->expectException(RuntimeException::class);
$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');
@ -30,7 +30,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
$this->expectException(Exception::class);
$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');
@ -42,7 +42,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
public function testRunRedisWorkerCommand()
{
$application = new Application($this->getClient()->getKernel());
$application = new Application($this->getTestClient()->getKernel());
$factory = new RedisMockFactory();
$redisMock = $factory->getAdapter(Client::class, true);

View file

@ -14,7 +14,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChrome()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome');
@ -26,7 +26,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChromeWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChromeBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/chrome');
@ -94,7 +94,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithChromeFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -135,7 +135,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/chrome');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious');
@ -26,7 +26,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/delicious');
@ -94,7 +94,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -135,7 +135,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithFileAndMarkAllAsRead()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -180,7 +180,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
public function testImportDeliciousWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/delicious');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/elcurator');
@ -26,7 +26,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcuratorWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcuratorBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/elcurator');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -95,7 +95,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
public function testImportElcuratorWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/elcurator');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox');
@ -26,7 +26,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportFirefoxWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportFirefoxBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/firefox');
@ -94,7 +94,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFirefoxFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -149,7 +149,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/firefox');
$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()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/import/');
@ -19,7 +19,7 @@ class ImportControllerTest extends WallabagCoreTestCase
public function testImportList()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/');

View file

@ -14,7 +14,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaper()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper');
@ -26,7 +26,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/instapaper');
@ -94,7 +94,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -148,7 +148,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithFileAndMarkAllAsRead()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -193,7 +193,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
public function testImportInstapaperWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/instapaper');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard');
@ -26,7 +26,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/pinboard');
@ -94,7 +94,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -140,7 +140,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithFileAndMarkAllAsRead()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -187,7 +187,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
public function testImportPinboardWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pinboard');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/pocket');
@ -23,7 +23,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -39,7 +39,7 @@ class PocketControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -54,7 +54,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketAuthBadToken()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/import/pocket/auth');
@ -64,7 +64,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketAuth()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$pocketImport = $this->getMockBuilder(PocketImport::class)
->disableOriginalConstructor()
@ -86,7 +86,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketCallbackWithBadToken()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$pocketImport = $this->getMockBuilder(PocketImport::class)
->disableOriginalConstructor()
@ -109,7 +109,7 @@ class PocketControllerTest extends WallabagCoreTestCase
public function testImportPocketCallback()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$pocketImport = $this->getMockBuilder(PocketImport::class)
->disableOriginalConstructor()

View file

@ -14,7 +14,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadability()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability');
@ -26,7 +26,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
$crawler = $client->request('GET', '/import/readability');
@ -94,7 +94,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -138,7 +138,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithFileAndMarkAllAsRead()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -185,7 +185,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
public function testImportReadabilityWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/readability');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1');
@ -26,7 +26,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -95,7 +95,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -139,7 +139,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFileAndMarkAllAsRead()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -186,7 +186,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v1');
$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()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2');
@ -26,7 +26,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithRabbitEnabled()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_rabbitmq', 1);
@ -42,7 +42,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagBadFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -60,7 +60,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$client->getContainer()->get(Config::class)->set('import_with_redis', 1);
@ -95,7 +95,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2');
$form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form();
@ -161,7 +161,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
public function testImportWallabagWithEmptyFile()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/import/wallabag-v2');
$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()
{
$client = $this->getClient();
$client = $this->getTestClient();
$client->request('GET', '/users/list');
@ -19,7 +19,7 @@ class ManageControllerTest extends WallabagCoreTestCase
public function testCompleteScenario()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
// Create a new user in the database
$crawler = $client->request('GET', '/users/list');
@ -71,7 +71,7 @@ class ManageControllerTest extends WallabagCoreTestCase
public function testDeleteDisabledForLoggedUser()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
$crawler = $client->request('GET', '/users/' . $this->getLoggedInUserId() . '/edit');
$disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
@ -82,7 +82,7 @@ class ManageControllerTest extends WallabagCoreTestCase
public function testUserSearch()
{
$this->logInAs('admin');
$client = $this->getClient();
$client = $this->getTestClient();
// Search on unread list
$crawler = $client->request('GET', '/users/list');

View file

@ -64,6 +64,6 @@ class AuthenticationFailureListenerTest extends TestCase
$records = $this->logHandler->getRecords();
$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']);
}
}