aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
index 85036e35..5d6a29fe 100644
--- a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
+++ b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php
@@ -2,7 +2,6 @@
2 2
3namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator; 3namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator;
4 4
5use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig;
6use Graby\SiteConfig\SiteConfig as GrabySiteConfig; 5use Graby\SiteConfig\SiteConfig as GrabySiteConfig;
7use Monolog\Handler\TestHandler; 6use Monolog\Handler\TestHandler;
8use Monolog\Logger; 7use Monolog\Logger;
@@ -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->assertSame( 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