From af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 26 Nov 2017 23:20:23 +0100 Subject: 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 --- tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php') 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 $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThan(0, $content['id']); $this->assertSame('http://www.example.com/', $content['url']); + $this->assertSame('www.example.com', $content['domain_name']); + $this->assertSame('www.example.com', $content['title']); } finally { // Remove the created entry to avoid side effects on other tests if (isset($content['id'])) { -- cgit v1.2.3