Move LoginFormAuthenticator directly in SiteConfig namespace

This commit is contained in:
Yassine Guedidi 2024-11-23 20:07:07 +01:00
parent ac6969f4cc
commit 0fdcbcf7fb
4 changed files with 9 additions and 10 deletions

View file

@ -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;

View file

@ -1,13 +1,12 @@
<?php
namespace Wallabag\SiteConfig\Authenticator;
namespace Wallabag\SiteConfig;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Cookie\CookieJar;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Wallabag\ExpressionLanguage\AuthenticatorProvider;
use Wallabag\SiteConfig\SiteConfig;
class LoginFormAuthenticator
{

View file

@ -14,7 +14,7 @@ use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Wallabag\Guzzle\AuthenticatorSubscriber;
use Wallabag\SiteConfig\ArraySiteConfigBuilder;
use Wallabag\SiteConfig\Authenticator\LoginFormAuthenticator;
use Wallabag\SiteConfig\LoginFormAuthenticator;
class AuthenticatorSubscriberTest extends TestCase
{

View file

@ -1,13 +1,13 @@
<?php
namespace Tests\Wallabag\SiteConfig\Authenticator;
namespace Tests\Wallabag\SiteConfig;
use GuzzleHttp\Client;
use GuzzleHttp\Message\Response;
use GuzzleHttp\Stream\Stream;
use GuzzleHttp\Subscriber\Mock;
use PHPUnit\Framework\TestCase;
use Wallabag\SiteConfig\Authenticator\LoginFormAuthenticator;
use Wallabag\SiteConfig\LoginFormAuthenticator;
use Wallabag\SiteConfig\SiteConfig;
class LoginFormAuthenticatorTest extends TestCase
@ -80,7 +80,7 @@ class LoginFormAuthenticatorTest extends TestCase
$response->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);
}