3 namespace Tests\Wallabag\CoreBundle\Twig
;
5 use Wallabag\CoreBundle\Twig\WallabagExtension
;
7 class WallabagExtensionTest
extends \PHPUnit_Framework_TestCase
9 public function testRemoveWww()
11 $entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
12 ->disableOriginalConstructor()
15 $tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
16 ->disableOriginalConstructor()
19 $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')
20 ->disableOriginalConstructor()
23 $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')
24 ->disableOriginalConstructor()
27 $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator);
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'));