X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FGuzzleSiteAuthenticator%2FGrabySiteConfigBuilderTest.php;fp=tests%2FWallabag%2FCoreBundle%2FGuzzleSiteAuthenticator%2FGrabySiteConfigBuilderTest.php;h=5d6a29fec9fcd9ec3efef558c8c51e87adb9d89d;hb=71e1cbc8eb5928d393b0772055d6b711e90a09b3;hp=b0c81e7b0cdf67290f28239d98ac40a879f85e3f;hpb=822c877949aff8ae57677671115f8f4fc69588d5;p=github%2Fwallabag%2Fwallabag.git 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 @@ namespace Tests\Wallabag\CoreBundle\GuzzleSiteAuthenticator; +use Graby\SiteConfig\SiteConfig as GrabySiteConfig; use Monolog\Handler\TestHandler; use Monolog\Logger; -use BD\GuzzleSiteAuthenticator\SiteConfig\SiteConfig; -use Graby\SiteConfig\SiteConfig as GrabySiteConfig; -use Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder; -use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; +use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; +use Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder; class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase { @@ -68,20 +67,15 @@ class GrabySiteConfigBuilderTest extends \PHPUnit_Framework_TestCase $config = $this->builder->buildForHost('www.example.com'); - $this->assertEquals( - new SiteConfig([ - 'host' => 'example.com', - 'requiresLogin' => true, - 'loginUri' => 'http://www.example.com/login', - 'usernameField' => 'login', - 'passwordField' => 'password', - 'extraFields' => ['field' => 'value'], - 'notLoggedInXpath' => '//div[@class="need-login"]', - 'username' => 'foo', - 'password' => 'bar', - ]), - $config - ); + $this->assertSame('example.com', $config->getHost()); + $this->assertSame(true, $config->requiresLogin()); + $this->assertSame('http://www.example.com/login', $config->getLoginUri()); + $this->assertSame('login', $config->getUsernameField()); + $this->assertSame('password', $config->getPasswordField()); + $this->assertSame(['field' => 'value'], $config->getExtraFields()); + $this->assertSame('//div[@class="need-login"]', $config->getNotLoggedInXpath()); + $this->assertSame('foo', $config->getUsername()); + $this->assertSame('bar', $config->getPassword()); $records = $handler->getRecords();