mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
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>
This commit is contained in:
parent
4a81360efc
commit
781864b954
2 changed files with 37 additions and 4 deletions
|
@ -775,6 +775,32 @@ class ContentProxyTest extends TestCase
|
|||
return $string;
|
||||
}
|
||||
|
||||
public function testWithChangedUrl()
|
||||
{
|
||||
$tagger = $this->getTaggerMock();
|
||||
$tagger->expects($this->once())
|
||||
->method('tag');
|
||||
|
||||
$proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true);
|
||||
$entry = new Entry(new User());
|
||||
$proxy->updateEntry(
|
||||
$entry,
|
||||
'http://0.0.0.0',
|
||||
[
|
||||
'html' => false,
|
||||
'title' => '',
|
||||
'url' => 'http://1.1.1.1',
|
||||
'content_type' => '',
|
||||
'language' => '',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$this->assertSame('http://1.1.1.1', $entry->getUrl());
|
||||
$this->assertSame('1.1.1.1', $entry->getDomainName());
|
||||
$this->assertSame('http://0.0.0.0', $entry->getOriginUrl());
|
||||
}
|
||||
|
||||
private function getTaggerMock()
|
||||
{
|
||||
return $this->getMockBuilder(RuleBasedTagger::class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue