forked from wallabag/wallabag
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:
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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¤tRoute=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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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.');
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user