]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
Add a real configuration for CS-Fixer
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Twig / WallabagExtensionTest.php
index 8ec2a75a228b1c202117525e7353f152dd1b1a50..ceec4b37b7a91316dcb8884cb074481d82e38606 100644 (file)
@@ -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'));
     }
 }