mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-15 18:00:36 +01:00
34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Tests\Wallabag\CoreBundle\Twig;
|
|
|
|
use Wallabag\CoreBundle\Twig\WallabagExtension;
|
|
|
|
class WallabagExtensionTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testRemoveWww()
|
|
{
|
|
$entryRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$tagRepository = $this->getMockBuilder('Wallabag\CoreBundle\Repository\TagRepository')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
|
|
$extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator);
|
|
|
|
$this->assertSame('lemonde.fr', $extension->removeWww('www.lemonde.fr'));
|
|
$this->assertSame('lemonde.fr', $extension->removeWww('lemonde.fr'));
|
|
$this->assertSame('gist.github.com', $extension->removeWww('gist.github.com'));
|
|
}
|
|
}
|