From 0fdcbcf7fbdc14ab8d1422b9a453ae4a4dcdc6e7 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sat, 23 Nov 2024 20:07:07 +0100 Subject: [PATCH] Move LoginFormAuthenticator directly in SiteConfig namespace --- src/Guzzle/AuthenticatorSubscriber.php | 2 +- .../{Authenticator => }/LoginFormAuthenticator.php | 3 +-- tests/Guzzle/AuthenticatorSubscriberTest.php | 2 +- .../LoginFormAuthenticatorTest.php | 12 ++++++------ 4 files changed, 9 insertions(+), 10 deletions(-) rename src/SiteConfig/{Authenticator => }/LoginFormAuthenticator.php (97%) rename tests/SiteConfig/{Authenticator => }/LoginFormAuthenticatorTest.php (94%) diff --git a/src/Guzzle/AuthenticatorSubscriber.php b/src/Guzzle/AuthenticatorSubscriber.php index c7a3b1083..4b565076e 100644 --- a/src/Guzzle/AuthenticatorSubscriber.php +++ b/src/Guzzle/AuthenticatorSubscriber.php @@ -9,7 +9,7 @@ use GuzzleHttp\Message\RequestInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; -use Wallabag\SiteConfig\Authenticator\LoginFormAuthenticator; +use Wallabag\SiteConfig\LoginFormAuthenticator; use Wallabag\SiteConfig\SiteConfig; use Wallabag\SiteConfig\SiteConfigBuilder; diff --git a/src/SiteConfig/Authenticator/LoginFormAuthenticator.php b/src/SiteConfig/LoginFormAuthenticator.php similarity index 97% rename from src/SiteConfig/Authenticator/LoginFormAuthenticator.php rename to src/SiteConfig/LoginFormAuthenticator.php index 00f8ab5ee..ab1d83970 100644 --- a/src/SiteConfig/Authenticator/LoginFormAuthenticator.php +++ b/src/SiteConfig/LoginFormAuthenticator.php @@ -1,13 +1,12 @@ expects($this->any()) ->method('getBody') - ->willReturn(file_get_contents(__DIR__ . '/../../fixtures/aoc.media.html')); + ->willReturn(file_get_contents(__DIR__ . '/../fixtures/aoc.media.html')); $response->expects($this->any()) ->method('getStatusCode') @@ -142,7 +142,7 @@ class LoginFormAuthenticatorTest extends TestCase $response->expects($this->any()) ->method('getBody') - ->willReturn(file_get_contents(__DIR__ . '/../../fixtures/nextinpact-login.html')); + ->willReturn(file_get_contents(__DIR__ . '/../fixtures/nextinpact-login.html')); $response->expects($this->any()) ->method('getStatusCode') @@ -211,7 +211,7 @@ class LoginFormAuthenticatorTest extends TestCase ]); $auth = new LoginFormAuthenticator(); - $loginRequired = $auth->isLoginRequired($siteConfig, file_get_contents(__DIR__ . '/../../fixtures/nextinpact-login.html')); + $loginRequired = $auth->isLoginRequired($siteConfig, file_get_contents(__DIR__ . '/../fixtures/nextinpact-login.html')); $this->assertFalse($loginRequired); } @@ -228,7 +228,7 @@ class LoginFormAuthenticatorTest extends TestCase ]); $auth = new LoginFormAuthenticator(); - $loginRequired = $auth->isLoginRequired($siteConfig, file_get_contents(__DIR__ . '/../../fixtures/nextinpact-article.html')); + $loginRequired = $auth->isLoginRequired($siteConfig, file_get_contents(__DIR__ . '/../fixtures/nextinpact-article.html')); $this->assertTrue($loginRequired); }