]>
Commit | Line | Data |
---|---|---|
784bb4c3 NL |
1 | <?php |
2 | ||
23634d5d | 3 | namespace Tests\Wallabag\CoreBundle\Twig; |
784bb4c3 NL |
4 | |
5 | use Wallabag\CoreBundle\Twig\WallabagExtension; | |
6 | ||
7 | class WallabagExtensionTest extends \PHPUnit_Framework_TestCase | |
8 | { | |
9 | public function testRemoveWww() | |
10 | { | |
1264029c JB |
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 | ||
e0f9010e TC |
19 | $notificationRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\NotificationRepository') |
20 | ->disableOriginalConstructor() | |
21 | ->getMock(); | |
22 | ||
1264029c JB |
23 | $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface') |
24 | ->disableOriginalConstructor() | |
25 | ->getMock(); | |
26 | ||
27 | $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface') | |
28 | ->disableOriginalConstructor() | |
29 | ->getMock(); | |
30 | ||
e0f9010e | 31 | $extension = new WallabagExtension($entryRepository, $tagRepository, $notificationRepository, $tokenStorage, 0, 5, $translator); |
784bb4c3 | 32 | |
ce782c84 NL |
33 | $this->assertEquals('lemonde.fr', $extension->removeWww('www.lemonde.fr')); |
34 | $this->assertEquals('lemonde.fr', $extension->removeWww('lemonde.fr')); | |
35 | $this->assertEquals('gist.github.com', $extension->removeWww('gist.github.com')); | |
784bb4c3 NL |
36 | } |
37 | } |