]> git.immae.eu Git - github/wallabag/wallabag.git/blob - tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php
Added check if there is only one user
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Twig / WallabagExtensionTest.php
1 <?php
2
3 namespace Tests\Wallabag\CoreBundle\Twig;
4
5 use Wallabag\CoreBundle\Twig\WallabagExtension;
6
7 class WallabagExtensionTest extends \PHPUnit_Framework_TestCase
8 {
9 public function testRemoveWww()
10 {
11 $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
12 ->disableOriginalConstructor()
13 ->getMock();
14
15 $tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
16 ->disableOriginalConstructor()
17 ->getMock();
18
19 $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')
20 ->disableOriginalConstructor()
21 ->getMock();
22
23 $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')
24 ->disableOriginalConstructor()
25 ->getMock();
26
27 $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator);
28
29 $this->assertEquals('lemonde.fr', $extension->removeWww('www.lemonde.fr'));
30 $this->assertEquals('lemonde.fr', $extension->removeWww('lemonde.fr'));
31 $this->assertEquals('gist.github.com', $extension->removeWww('gist.github.com'));
32 }
33 }