Merge branch '2.6'

# Conflicts:
#	src/Repository/EntryRepository.php
#	src/Twig/WallabagExtension.php
#	src/Wallabag/CoreBundle/Resources/views/Entry/_card_actions.html.twig
#	src/Wallabag/CoreBundle/Resources/views/Entry/_card_list.html.twig
#	tests/Twig/WallabagExtensionTest.php
This commit is contained in:
Yassine Guedidi
2025-03-18 20:59:39 +01:00
9 changed files with 68 additions and 32 deletions

View File

@ -5,6 +5,7 @@ namespace Tests\Wallabag\Twig;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\Repository\AnnotationRepository;
use Wallabag\Repository\EntryRepository;
use Wallabag\Repository\TagRepository;
use Wallabag\Twig\WallabagExtension;
@ -17,6 +18,10 @@ class WallabagExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$annotationRepository = $this->getMockBuilder(AnnotationRepository::class)
->disableOriginalConstructor()
->getMock();
$tagRepository = $this->getMockBuilder(TagRepository::class)
->disableOriginalConstructor()
->getMock();
@ -29,7 +34,7 @@ class WallabagExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator, '');
$extension = new WallabagExtension($entryRepository, $annotationRepository, $tagRepository, $tokenStorage, 0, $translator, '');
$this->assertSame('lemonde.fr', $extension->removeWww('www.lemonde.fr'));
$this->assertSame('lemonde.fr', $extension->removeWww('lemonde.fr'));
@ -42,6 +47,10 @@ class WallabagExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$annotationRepository = $this->getMockBuilder(AnnotationRepository::class)
->disableOriginalConstructor()
->getMock();
$tagRepository = $this->getMockBuilder(TagRepository::class)
->disableOriginalConstructor()
->getMock();
@ -54,7 +63,7 @@ class WallabagExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator, '');
$extension = new WallabagExtension($entryRepository, $annotationRepository, $tagRepository, $tokenStorage, 0, $translator, '');
$this->assertSame('lemonde.fr', $extension->removeScheme('lemonde.fr'));
$this->assertSame('gist.github.com', $extension->removeScheme('gist.github.com'));
@ -68,6 +77,10 @@ class WallabagExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$annotationRepository = $this->getMockBuilder(AnnotationRepository::class)
->disableOriginalConstructor()
->getMock();
$tagRepository = $this->getMockBuilder(TagRepository::class)
->disableOriginalConstructor()
->getMock();
@ -80,7 +93,7 @@ class WallabagExtensionTest extends TestCase
->disableOriginalConstructor()
->getMock();
$extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator, '');
$extension = new WallabagExtension($entryRepository, $annotationRepository, $tagRepository, $tokenStorage, 0, $translator, '');
$this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('www.lemonde.fr'));
$this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('http://www.lemonde.fr'));