X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FTwig%2FWallabagExtensionTest.php;h=ceec4b37b7a91316dcb8884cb074481d82e38606;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=8ec2a75a228b1c202117525e7353f152dd1b1a50;hpb=d37bb05c881bfdbeb1144b327edd4dcc2cbb163f;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php index 8ec2a75a..ceec4b37 100644 --- a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php +++ b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php @@ -8,10 +8,26 @@ class WallabagExtensionTest extends \PHPUnit_Framework_TestCase { public function testRemoveWww() { - $extension = new WallabagExtension(); + $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') + ->disableOriginalConstructor() + ->getMock(); - $this->assertEquals('lemonde.fr', $extension->removeWww('www.lemonde.fr')); - $this->assertEquals('lemonde.fr', $extension->removeWww('lemonde.fr')); - $this->assertEquals('gist.github.com', $extension->removeWww('gist.github.com')); + $tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository') + ->disableOriginalConstructor() + ->getMock(); + + $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface') + ->disableOriginalConstructor() + ->getMock(); + + $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface') + ->disableOriginalConstructor() + ->getMock(); + + $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator); + + $this->assertSame('lemonde.fr', $extension->removeWww('www.lemonde.fr')); + $this->assertSame('lemonde.fr', $extension->removeWww('lemonde.fr')); + $this->assertSame('gist.github.com', $extension->removeWww('gist.github.com')); } }