aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2018-01-07 17:28:04 +0100
committerKevin Decherf <kevin@kdecherf.com>2018-10-21 16:15:31 +0200
commit781864b9546b0ff2d6fe42ce72f78b8f40b785e9 (patch)
treea6054e663c45e382b9aa140e18b91db8be0e5bd1 /tests/Wallabag
parent4a81360efcdfe4bab8d75f7227c9cf5bfd514189 (diff)
downloadwallabag-781864b9546b0ff2d6fe42ce72f78b8f40b785e9.tar.gz
wallabag-781864b9546b0ff2d6fe42ce72f78b8f40b785e9.tar.zst
wallabag-781864b9546b0ff2d6fe42ce72f78b8f40b785e9.zip
ContentProxy: swap entry url to origin_url and set new url according to graby content
Closes #3529 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index 3f3c60d0..84b38f02 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -775,6 +775,32 @@ class ContentProxyTest extends TestCase
775 return $string; 775 return $string;
776 } 776 }
777 777
778 public function testWithChangedUrl()
779 {
780 $tagger = $this->getTaggerMock();
781 $tagger->expects($this->once())
782 ->method('tag');
783
784 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true);
785 $entry = new Entry(new User());
786 $proxy->updateEntry(
787 $entry,
788 'http://0.0.0.0',
789 [
790 'html' => false,
791 'title' => '',
792 'url' => 'http://1.1.1.1',
793 'content_type' => '',
794 'language' => '',
795 ],
796 true
797 );
798
799 $this->assertSame('http://1.1.1.1', $entry->getUrl());
800 $this->assertSame('1.1.1.1', $entry->getDomainName());
801 $this->assertSame('http://0.0.0.0', $entry->getOriginUrl());
802 }
803
778 private function getTaggerMock() 804 private function getTaggerMock()
779 { 805 {
780 return $this->getMockBuilder(RuleBasedTagger::class) 806 return $this->getMockBuilder(RuleBasedTagger::class)