diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2017-11-26 23:20:23 +0100 |
---|---|---|
committer | Kevin Decherf <kevin@kdecherf.com> | 2017-12-13 22:44:31 +0100 |
commit | af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6 (patch) | |
tree | b4e0a8e01717f3d8d96138033bf8ce1696a127a7 /tests/Wallabag/ApiBundle | |
parent | 70265817aee257e7e635eda79ce3e037e3b4a242 (diff) | |
download | wallabag-af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6.tar.gz wallabag-af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6.tar.zst wallabag-af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6.zip |
Fix empty title and domain_name when exception is thrown during fetch
Add a new helper to set a default title when it's empty:
1/ use basename part of entry's path, if any
2/ or use domain name
Fixes #2053
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'tests/Wallabag/ApiBundle')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index b0d4c4e1..5c7b988c 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -501,6 +501,8 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
501 | $content = json_decode($this->client->getResponse()->getContent(), true); | 501 | $content = json_decode($this->client->getResponse()->getContent(), true); |
502 | $this->assertGreaterThan(0, $content['id']); | 502 | $this->assertGreaterThan(0, $content['id']); |
503 | $this->assertSame('http://www.example.com/', $content['url']); | 503 | $this->assertSame('http://www.example.com/', $content['url']); |
504 | $this->assertSame('www.example.com', $content['domain_name']); | ||
505 | $this->assertSame('www.example.com', $content['title']); | ||
504 | } finally { | 506 | } finally { |
505 | // Remove the created entry to avoid side effects on other tests | 507 | // Remove the created entry to avoid side effects on other tests |
506 | if (isset($content['id'])) { | 508 | if (isset($content['id'])) { |