diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2018-01-07 17:28:04 +0100 |
---|---|---|
committer | Kevin Decherf <kevin@kdecherf.com> | 2018-01-14 16:41:56 +0100 |
commit | c801d03e46ae036d8b1898f884769e361c51ed58 (patch) | |
tree | 5392b0669d0320582d4df621f607fd64f07a1490 /tests/Wallabag | |
parent | 3362b3e3d340e6e24d703b38010870479ab0f67c (diff) | |
download | wallabag-c801d03e46ae036d8b1898f884769e361c51ed58.tar.gz wallabag-c801d03e46ae036d8b1898f884769e361c51ed58.tar.zst wallabag-c801d03e46ae036d8b1898f884769e361c51ed58.zip |
ContentProxy: swap entry url to origin_url and set new url according to graby contenturl-3529
Closes #3529
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 398592e1..c1a56b89 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | |||
@@ -532,6 +532,32 @@ class ContentProxyTest extends TestCase | |||
532 | $this->assertSame('1.1.1.1', $entry->getDomainName()); | 532 | $this->assertSame('1.1.1.1', $entry->getDomainName()); |
533 | } | 533 | } |
534 | 534 | ||
535 | public function testWithChangedUrl() | ||
536 | { | ||
537 | $tagger = $this->getTaggerMock(); | ||
538 | $tagger->expects($this->once()) | ||
539 | ->method('tag'); | ||
540 | |||
541 | $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true); | ||
542 | $entry = new Entry(new User()); | ||
543 | $proxy->updateEntry( | ||
544 | $entry, | ||
545 | 'http://0.0.0.0', | ||
546 | [ | ||
547 | 'html' => false, | ||
548 | 'title' => '', | ||
549 | 'url' => 'http://1.1.1.1', | ||
550 | 'content_type' => '', | ||
551 | 'language' => '', | ||
552 | ], | ||
553 | true | ||
554 | ); | ||
555 | |||
556 | $this->assertSame('http://1.1.1.1', $entry->getUrl()); | ||
557 | $this->assertSame('1.1.1.1', $entry->getDomainName()); | ||
558 | $this->assertSame('http://0.0.0.0', $entry->getOriginUrl()); | ||
559 | } | ||
560 | |||
535 | private function getTaggerMock() | 561 | private function getTaggerMock() |
536 | { | 562 | { |
537 | return $this->getMockBuilder(RuleBasedTagger::class) | 563 | return $this->getMockBuilder(RuleBasedTagger::class) |