mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-07 07:58:48 +00:00
Move LoginFormAuthenticator directly in SiteConfig namespace
This commit is contained in:
parent
ac6969f4cc
commit
0fdcbcf7fb
4 changed files with 9 additions and 10 deletions
|
@ -9,7 +9,7 @@ use GuzzleHttp\Message\RequestInterface;
|
||||||
use Psr\Log\LoggerAwareInterface;
|
use Psr\Log\LoggerAwareInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
use Wallabag\SiteConfig\Authenticator\LoginFormAuthenticator;
|
use Wallabag\SiteConfig\LoginFormAuthenticator;
|
||||||
use Wallabag\SiteConfig\SiteConfig;
|
use Wallabag\SiteConfig\SiteConfig;
|
||||||
use Wallabag\SiteConfig\SiteConfigBuilder;
|
use Wallabag\SiteConfig\SiteConfigBuilder;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Wallabag\SiteConfig\Authenticator;
|
namespace Wallabag\SiteConfig;
|
||||||
|
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Cookie\CookieJar;
|
use GuzzleHttp\Cookie\CookieJar;
|
||||||
use Symfony\Component\DomCrawler\Crawler;
|
use Symfony\Component\DomCrawler\Crawler;
|
||||||
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
||||||
use Wallabag\ExpressionLanguage\AuthenticatorProvider;
|
use Wallabag\ExpressionLanguage\AuthenticatorProvider;
|
||||||
use Wallabag\SiteConfig\SiteConfig;
|
|
||||||
|
|
||||||
class LoginFormAuthenticator
|
class LoginFormAuthenticator
|
||||||
{
|
{
|
|
@ -14,7 +14,7 @@ use Monolog\Logger;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Wallabag\Guzzle\AuthenticatorSubscriber;
|
use Wallabag\Guzzle\AuthenticatorSubscriber;
|
||||||
use Wallabag\SiteConfig\ArraySiteConfigBuilder;
|
use Wallabag\SiteConfig\ArraySiteConfigBuilder;
|
||||||
use Wallabag\SiteConfig\Authenticator\LoginFormAuthenticator;
|
use Wallabag\SiteConfig\LoginFormAuthenticator;
|
||||||
|
|
||||||
class AuthenticatorSubscriberTest extends TestCase
|
class AuthenticatorSubscriberTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Wallabag\SiteConfig\Authenticator;
|
namespace Tests\Wallabag\SiteConfig;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Message\Response;
|
use GuzzleHttp\Message\Response;
|
||||||
use GuzzleHttp\Stream\Stream;
|
use GuzzleHttp\Stream\Stream;
|
||||||
use GuzzleHttp\Subscriber\Mock;
|
use GuzzleHttp\Subscriber\Mock;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Wallabag\SiteConfig\Authenticator\LoginFormAuthenticator;
|
use Wallabag\SiteConfig\LoginFormAuthenticator;
|
||||||
use Wallabag\SiteConfig\SiteConfig;
|
use Wallabag\SiteConfig\SiteConfig;
|
||||||
|
|
||||||
class LoginFormAuthenticatorTest extends TestCase
|
class LoginFormAuthenticatorTest extends TestCase
|
||||||
|
@ -80,7 +80,7 @@ class LoginFormAuthenticatorTest extends TestCase
|
||||||
|
|
||||||
$response->expects($this->any())
|
$response->expects($this->any())
|
||||||
->method('getBody')
|
->method('getBody')
|
||||||
->willReturn(file_get_contents(__DIR__ . '/../../fixtures/aoc.media.html'));
|
->willReturn(file_get_contents(__DIR__ . '/../fixtures/aoc.media.html'));
|
||||||
|
|
||||||
$response->expects($this->any())
|
$response->expects($this->any())
|
||||||
->method('getStatusCode')
|
->method('getStatusCode')
|
||||||
|
@ -142,7 +142,7 @@ class LoginFormAuthenticatorTest extends TestCase
|
||||||
|
|
||||||
$response->expects($this->any())
|
$response->expects($this->any())
|
||||||
->method('getBody')
|
->method('getBody')
|
||||||
->willReturn(file_get_contents(__DIR__ . '/../../fixtures/nextinpact-login.html'));
|
->willReturn(file_get_contents(__DIR__ . '/../fixtures/nextinpact-login.html'));
|
||||||
|
|
||||||
$response->expects($this->any())
|
$response->expects($this->any())
|
||||||
->method('getStatusCode')
|
->method('getStatusCode')
|
||||||
|
@ -211,7 +211,7 @@ class LoginFormAuthenticatorTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$auth = new LoginFormAuthenticator();
|
$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);
|
$this->assertFalse($loginRequired);
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ class LoginFormAuthenticatorTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$auth = new LoginFormAuthenticator();
|
$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);
|
$this->assertTrue($loginRequired);
|
||||||
}
|
}
|
Loading…
Reference in a new issue