aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
index bb92f745..39fcec16 100644
--- a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
+++ b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
@@ -32,6 +32,31 @@ class WallabagExtensionTest extends TestCase
32 $this->assertSame('gist.github.com', $extension->removeWww('gist.github.com')); 32 $this->assertSame('gist.github.com', $extension->removeWww('gist.github.com'));
33 } 33 }
34 34
35 public function testRemoveScheme()
36 {
37 $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
38 ->disableOriginalConstructor()
39 ->getMock();
40
41 $tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
42 ->disableOriginalConstructor()
43 ->getMock();
44
45 $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')
46 ->disableOriginalConstructor()
47 ->getMock();
48
49 $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')
50 ->disableOriginalConstructor()
51 ->getMock();
52
53 $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator);
54
55 $this->assertSame('lemonde.fr', $extension->removeScheme('lemonde.fr'));
56 $this->assertSame('gist.github.com', $extension->removeScheme('gist.github.com'));
57 $this->assertSame('gist.github.com', $extension->removeScheme('https://gist.github.com'));
58 }
59
35 public function testRemoveSchemeAndWww() 60 public function testRemoveSchemeAndWww()
36 { 61 {
37 $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository') 62 $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')