]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
Changed RSS to Atom feed and improve paging
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Twig / WallabagExtensionTest.php
index bb92f74587b36018e856f8e07d45561d45eb28fe..3fd90fda10ab6884b5081c02a082d052d10ff029 100644 (file)
@@ -32,6 +32,31 @@ class WallabagExtensionTest extends TestCase
         $this->assertSame('gist.github.com', $extension->removeWww('gist.github.com'));
     }
 
+    public function testRemoveScheme()
+    {
+        $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $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->assertEquals('lemonde.fr', $extension->removeScheme('lemonde.fr'));
+        $this->assertEquals('gist.github.com', $extension->removeScheme('gist.github.com'));
+        $this->assertEquals('gist.github.com', $extension->removeScheme('https://gist.github.com'));
+    }
+
     public function testRemoveSchemeAndWww()
     {
         $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')