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

Move site config from property to parameter in LoginFormAuthenticator

This commit is contained in:
Yassine Guedidi 2024-11-23 11:27:18 +01:00
parent aec8e26058
commit 81d269dec1
5 changed files with 35 additions and 43 deletions

View file

@ -35,8 +35,8 @@ class LoginFormAuthenticatorTest extends TestCase
'password' => 'unkn0wn',
]);
$auth = new LoginFormAuthenticator($siteConfig);
$res = $auth->login($guzzle);
$auth = new LoginFormAuthenticator();
$res = $auth->login($siteConfig, $guzzle);
$this->assertInstanceOf(LoginFormAuthenticator::class, $res);
}
@ -65,8 +65,8 @@ class LoginFormAuthenticatorTest extends TestCase
'password' => 'unkn0wn',
]);
$auth = new LoginFormAuthenticator($siteConfig);
$res = $auth->login($guzzle);
$auth = new LoginFormAuthenticator();
$res = $auth->login($siteConfig, $guzzle);
$this->assertInstanceOf(LoginFormAuthenticator::class, $res);
}
@ -128,8 +128,8 @@ class LoginFormAuthenticatorTest extends TestCase
'password' => 'unkn0wn',
]);
$auth = new LoginFormAuthenticator($siteConfig);
$res = $auth->login($client);
$auth = new LoginFormAuthenticator();
$res = $auth->login($siteConfig, $client);
$this->assertInstanceOf(LoginFormAuthenticator::class, $res);
}
@ -194,8 +194,8 @@ class LoginFormAuthenticatorTest extends TestCase
'password' => 'unkn0wn',
]);
$auth = new LoginFormAuthenticator($siteConfig);
$res = $auth->login($client);
$auth = new LoginFormAuthenticator();
$res = $auth->login($siteConfig, $client);
$this->assertInstanceOf(LoginFormAuthenticator::class, $res);
}
@ -210,8 +210,8 @@ class LoginFormAuthenticatorTest extends TestCase
'password' => 'unkn0wn',
]);
$auth = new LoginFormAuthenticator($siteConfig);
$loginRequired = $auth->isLoginRequired(file_get_contents(__DIR__ . '/../../fixtures/nextinpact-login.html'));
$auth = new LoginFormAuthenticator();
$loginRequired = $auth->isLoginRequired($siteConfig, file_get_contents(__DIR__ . '/../../fixtures/nextinpact-login.html'));
$this->assertFalse($loginRequired);
}
@ -227,8 +227,8 @@ class LoginFormAuthenticatorTest extends TestCase
'notLoggedInXpath' => '//h2[@class="title_reserve_article"]',
]);
$auth = new LoginFormAuthenticator($siteConfig);
$loginRequired = $auth->isLoginRequired(file_get_contents(__DIR__ . '/../../fixtures/nextinpact-article.html'));
$auth = new LoginFormAuthenticator();
$loginRequired = $auth->isLoginRequired($siteConfig, file_get_contents(__DIR__ . '/../../fixtures/nextinpact-article.html'));
$this->assertTrue($loginRequired);
}