diff options
Diffstat (limited to 'tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php')
-rw-r--r-- | tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php index b0c81e7b..5d6a29fe 100644 --- a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php +++ b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php | |||
@@ -2,13 +2,12 @@ | |||
2 | 2 | ||
3 | namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator; | 3 | namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator; |
4 | 4 | ||
5 | use Graby\SiteConfig\SiteConfig as GrabySiteConfig; | ||
5 | use Monolog\Handler\TestHandler; | 6 | use Monolog\Handler\TestHandler; |
6 | use Monolog\Logger; | 7 | use Monolog\Logger; |
7 | use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig; | ||
8 | use Graby\SiteConfig\SiteConfig as GrabySiteConfig; | ||
9 | use Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder; | ||
10 | use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | ||
11 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; | 8 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; |
9 | use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | ||
10 | use Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder; | ||
12 | 11 | ||
13 | class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase | 12 | class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase |
14 | { | 13 | { |
@@ -68,20 +67,15 @@ class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase | |||
68 | 67 | ||
69 | $config = $this->builder->buildForHost('www.example.com'); | 68 | $config = $this->builder->buildForHost('www.example.com'); |
70 | 69 | ||
71 | $this->assertEquals( | 70 | $this->assertSame('example.com', $config->getHost()); |
72 | new SiteConfig([ | 71 | $this->assertSame(true, $config->requiresLogin()); |
73 | 'host' => 'example.com', | 72 | $this->assertSame('http://www.example.com/login', $config->getLoginUri()); |
74 | 'requiresLogin' => true, | 73 | $this->assertSame('login', $config->getUsernameField()); |
75 | 'loginUri' => 'http://www.example.com/login', | 74 | $this->assertSame('password', $config->getPasswordField()); |
76 | 'usernameField' => 'login', | 75 | $this->assertSame(['field' => 'value'], $config->getExtraFields()); |
77 | 'passwordField' => 'password', | 76 | $this->assertSame('//div[@class="need-login"]', $config->getNotLoggedInXpath()); |
78 | 'extraFields' => ['field' => 'value'], | 77 | $this->assertSame('foo', $config->getUsername()); |
79 | 'notLoggedInXpath' => '//div[@class="need-login"]', | 78 | $this->assertSame('bar', $config->getPassword()); |
80 | 'username' => 'foo', | ||
81 | 'password' => 'bar', | ||
82 | ]), | ||
83 | $config | ||
84 | ); | ||
85 | 79 | ||
86 | $records = $handler->getRecords(); | 80 | $records = $handler->getRecords(); |
87 | 81 | ||