aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
diff options
context:
space:
mode:
authorlizyn <zhiylin@outlook.com>2020-02-24 10:04:13 +0800
committerGitHub <noreply@github.com>2020-02-24 10:04:13 +0800
commitb19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch)
treed0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
parent04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff)
downloadwallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip
Merge pull request #1 from wallabag/master
Keep up with the master again
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')