From 3ce94409ab650e042993480d638482a89901776d Mon Sep 17 00:00:00 2001 From: Dag Date: Tue, 9 Jan 2024 20:18:33 +0100 Subject: [PATCH] feat: support itunes namespace in top channel feed (#3776) Also preserves other properties. --- actions/DisplayAction.php | 11 +- bridges/ItakuBridge.php | 6 +- formats/AtomFormat.php | 81 ++++++------ formats/HtmlFormat.php | 12 +- formats/JsonFormat.php | 18 +-- formats/MrssFormat.php | 124 ++++++++++-------- formats/PlaintextFormat.php | 6 +- lib/BridgeAbstract.php | 53 +++++--- lib/FormatAbstract.php | 59 ++++----- lib/bootstrap.php | 3 - tests/FormatTest.php | 72 ++++++++++ tests/Formats/BaseFormatTest.php | 2 +- .../expectedAtomFormat/feed.common.xml | 6 +- .../samples/expectedAtomFormat/feed.empty.xml | 6 +- .../expectedAtomFormat/feed.emptyItems.xml | 6 +- .../expectedAtomFormat/feed.microblog.xml | 6 +- .../expectedMrssFormat/feed.common.xml | 6 +- .../samples/expectedMrssFormat/feed.empty.xml | 2 +- .../expectedMrssFormat/feed.emptyItems.xml | 2 +- .../expectedMrssFormat/feed.microblog.xml | 6 +- tests/Formats/samples/feed.empty.json | 2 +- tests/Formats/samples/feed.emptyItems.json | 2 +- 22 files changed, 293 insertions(+), 198 deletions(-) create mode 100644 tests/FormatTest.php diff --git a/actions/DisplayAction.php b/actions/DisplayAction.php index 435639966fd..080da52ea59 100644 --- a/actions/DisplayAction.php +++ b/actions/DisplayAction.php @@ -100,7 +100,7 @@ public function execute(array $request) private function createResponse(array $request, BridgeAbstract $bridge, FormatAbstract $format) { $items = []; - $infos = []; + $feed = []; try { $bridge->loadConfiguration(); @@ -116,12 +116,7 @@ private function createResponse(array $request, BridgeAbstract $bridge, FormatAb } $items = $feedItems; } - $infos = [ - 'name' => $bridge->getName(), - 'uri' => $bridge->getURI(), - 'donationUri' => $bridge->getDonationURI(), - 'icon' => $bridge->getIcon() - ]; + $feed = $bridge->getFeed(); } catch (\Exception $e) { if ($e instanceof HttpException) { // Reproduce (and log) these responses regardless of error output and report limit @@ -155,7 +150,7 @@ private function createResponse(array $request, BridgeAbstract $bridge, FormatAb } $format->setItems($items); - $format->setExtraInfos($infos); + $format->setFeed($feed); $now = time(); $format->setLastModified($now); $headers = [ diff --git a/bridges/ItakuBridge.php b/bridges/ItakuBridge.php index 149757f5c4e..0577752cc55 100644 --- a/bridges/ItakuBridge.php +++ b/bridges/ItakuBridge.php @@ -280,7 +280,7 @@ public function collectData() $opt['range'] = ''; $user_id = $this->getInput('user_id') ?? $this->getOwnerID($this->getInput('user')); - $data = $this->getFeed( + $data = $this->getFeedData( $opt, $user_id ); @@ -289,7 +289,7 @@ public function collectData() if ($this->queriedContext === 'Home feed') { $opt['order'] = $this->getInput('order'); $opt['range'] = $this->getInput('range'); - $data = $this->getFeed($opt); + $data = $this->getFeedData($opt); } foreach ($data['results'] as $record) { @@ -409,7 +409,7 @@ private function getPostsSearch(array $opt) return $this->getData($url, false, true); } - private function getFeed(array $opt, $ownerID = null) + private function getFeedData(array $opt, $ownerID = null) { $url = self::URI . "/api/feed/?date_range={$opt['range']}&ordering={$opt['order']}&page=1&page_size=30&format=json"; diff --git a/formats/AtomFormat.php b/formats/AtomFormat.php index 07ca7272f5d..1fabef2e7f5 100644 --- a/formats/AtomFormat.php +++ b/formats/AtomFormat.php @@ -17,44 +17,61 @@ class AtomFormat extends FormatAbstract public function stringify() { $document = new \DomDocument('1.0', $this->getCharset()); + $document->formatOutput = true; $feedUrl = get_current_url(); - $extraInfos = $this->getExtraInfos(); - if (empty($extraInfos['uri'])) { - $uri = REPOSITORY; - } else { - $uri = $extraInfos['uri']; - } - - $document->formatOutput = true; $feed = $document->createElementNS(self::ATOM_NS, 'feed'); $document->appendChild($feed); $feed->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:media', self::MRSS_NS); - $title = $document->createElement('title'); - $feed->appendChild($title); - $title->setAttribute('type', 'text'); - $title->appendChild($document->createTextNode($extraInfos['name'])); + $feedArray = $this->getFeed(); + foreach ($feedArray as $feedKey => $feedValue) { + if (in_array($feedKey, ['donationUri'])) { + continue; + } + if ($feedKey === 'name') { + $title = $document->createElement('title'); + $feed->appendChild($title); + $title->setAttribute('type', 'text'); + $title->appendChild($document->createTextNode($feedValue)); + } elseif ($feedKey === 'icon') { + if ($feedValue) { + $icon = $document->createElement('icon'); + $feed->appendChild($icon); + $icon->appendChild($document->createTextNode($feedValue)); + + $logo = $document->createElement('logo'); + $feed->appendChild($logo); + $logo->appendChild($document->createTextNode($feedValue)); + } + } elseif ($feedKey === 'uri') { + if ($feedValue) { + $linkAlternate = $document->createElement('link'); + $feed->appendChild($linkAlternate); + $linkAlternate->setAttribute('rel', 'alternate'); + $linkAlternate->setAttribute('type', 'text/html'); + $linkAlternate->setAttribute('href', $feedValue); + + $linkSelf = $document->createElement('link'); + $feed->appendChild($linkSelf); + $linkSelf->setAttribute('rel', 'self'); + $linkSelf->setAttribute('type', 'application/atom+xml'); + $linkSelf->setAttribute('href', $feedUrl); + } + } elseif ($feedKey === 'itunes') { + // todo: skip? + } else { + $element = $document->createElement($feedKey); + $feed->appendChild($element); + $element->appendChild($document->createTextNode($feedValue)); + } + } $id = $document->createElement('id'); $feed->appendChild($id); $id->appendChild($document->createTextNode($feedUrl)); - $uriparts = parse_url($uri); - if (empty($extraInfos['icon'])) { - $iconUrl = $uriparts['scheme'] . '://' . $uriparts['host'] . '/favicon.ico'; - } else { - $iconUrl = $extraInfos['icon']; - } - $icon = $document->createElement('icon'); - $feed->appendChild($icon); - $icon->appendChild($document->createTextNode($iconUrl)); - - $logo = $document->createElement('logo'); - $feed->appendChild($logo); - $logo->appendChild($document->createTextNode($iconUrl)); - $feedTimestamp = gmdate(DATE_ATOM, $this->lastModified); $updated = $document->createElement('updated'); $feed->appendChild($updated); @@ -69,17 +86,7 @@ public function stringify() $author->appendChild($authorName); $authorName->appendChild($document->createTextNode($feedAuthor)); - $linkAlternate = $document->createElement('link'); - $feed->appendChild($linkAlternate); - $linkAlternate->setAttribute('rel', 'alternate'); - $linkAlternate->setAttribute('type', 'text/html'); - $linkAlternate->setAttribute('href', $uri); - - $linkSelf = $document->createElement('link'); - $feed->appendChild($linkSelf); - $linkSelf->setAttribute('rel', 'self'); - $linkSelf->setAttribute('type', 'application/atom+xml'); - $linkSelf->setAttribute('href', $feedUrl); + foreach ($this->getItems() as $item) { $itemArray = $item->toArray(); diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php index 4933af8d720..ef66f493375 100644 --- a/formats/HtmlFormat.php +++ b/formats/HtmlFormat.php @@ -8,7 +8,7 @@ public function stringify() { $queryString = $_SERVER['QUERY_STRING']; - $extraInfos = $this->getExtraInfos(); + $feedArray = $this->getFeed(); $formatFactory = new FormatFactory(); $buttons = []; $linkTags = []; @@ -29,9 +29,9 @@ public function stringify() ]; } - if (Configuration::getConfig('admin', 'donations') && $extraInfos['donationUri'] !== '') { + if (Configuration::getConfig('admin', 'donations') && $feedArray['donationUri']) { $buttons[] = [ - 'href' => e($extraInfos['donationUri']), + 'href' => e($feedArray['donationUri']), 'value' => 'Donate to maintainer', ]; } @@ -39,7 +39,7 @@ public function stringify() $items = []; foreach ($this->getItems() as $item) { $items[] = [ - 'url' => $item->getURI() ?: $extraInfos['uri'], + 'url' => $item->getURI() ?: $feedArray['uri'], 'title' => $item->getTitle() ?? '(no title)', 'timestamp' => $item->getTimestamp(), 'author' => $item->getAuthor(), @@ -51,9 +51,9 @@ public function stringify() $html = render_template(__DIR__ . '/../templates/html-format.html.php', [ 'charset' => $this->getCharset(), - 'title' => $extraInfos['name'], + 'title' => $feedArray['name'], 'linkTags' => $linkTags, - 'uri' => $extraInfos['uri'], + 'uri' => $feedArray['uri'], 'buttons' => $buttons, 'items' => $items, ]); diff --git a/formats/JsonFormat.php b/formats/JsonFormat.php index dd61da41d8c..016e75e1177 100644 --- a/formats/JsonFormat.php +++ b/formats/JsonFormat.php @@ -25,18 +25,18 @@ class JsonFormat extends FormatAbstract public function stringify() { - $host = $_SERVER['HTTP_HOST'] ?? ''; - $extraInfos = $this->getExtraInfos(); + $feedArray = $this->getFeed(); + $data = [ - 'version' => 'https://jsonfeed.org/version/1', - 'title' => empty($extraInfos['name']) ? $host : $extraInfos['name'], - 'home_page_url' => empty($extraInfos['uri']) ? REPOSITORY : $extraInfos['uri'], - 'feed_url' => get_current_url(), + 'version' => 'https://jsonfeed.org/version/1', + 'title' => $feedArray['name'], + 'home_page_url' => $feedArray['uri'], + 'feed_url' => get_current_url(), ]; - if (!empty($extraInfos['icon'])) { - $data['icon'] = $extraInfos['icon']; - $data['favicon'] = $extraInfos['icon']; + if ($feedArray['icon']) { + $data['icon'] = $feedArray['icon']; + $data['favicon'] = $feedArray['icon']; } $items = []; diff --git a/formats/MrssFormat.php b/formats/MrssFormat.php index 5b96a6a75a6..e93a8289fd9 100644 --- a/formats/MrssFormat.php +++ b/formats/MrssFormat.php @@ -35,16 +35,8 @@ class MrssFormat extends FormatAbstract public function stringify() { $document = new \DomDocument('1.0', $this->getCharset()); - - $feedUrl = get_current_url(); - $extraInfos = $this->getExtraInfos(); - if (empty($extraInfos['uri'])) { - $uri = REPOSITORY; - } else { - $uri = $extraInfos['uri']; - } - $document->formatOutput = true; + $feed = $document->createElement('rss'); $document->appendChild($feed); $feed->setAttribute('version', '2.0'); @@ -54,50 +46,73 @@ public function stringify() $channel = $document->createElement('channel'); $feed->appendChild($channel); - $title = $extraInfos['name']; - $channelTitle = $document->createElement('title'); - $channel->appendChild($channelTitle); - $channelTitle->appendChild($document->createTextNode($title)); - - $link = $document->createElement('link'); - $channel->appendChild($link); - $link->appendChild($document->createTextNode($uri)); - - $description = $document->createElement('description'); - $channel->appendChild($description); - $description->appendChild($document->createTextNode($extraInfos['name'])); - - $allowedIconExtensions = [ - '.gif', - '.jpg', - '.png', - ]; - $icon = $extraInfos['icon']; - if (!empty($icon) && in_array(substr($icon, -4), $allowedIconExtensions)) { - $feedImage = $document->createElement('image'); - $channel->appendChild($feedImage); - $iconUrl = $document->createElement('url'); - $iconUrl->appendChild($document->createTextNode($icon)); - $feedImage->appendChild($iconUrl); - $iconTitle = $document->createElement('title'); - $iconTitle->appendChild($document->createTextNode($title)); - $feedImage->appendChild($iconTitle); - $iconLink = $document->createElement('link'); - $iconLink->appendChild($document->createTextNode($uri)); - $feedImage->appendChild($iconLink); - } + $feedArray = $this->getFeed(); + $uri = $feedArray['uri']; + $title = $feedArray['name']; - $linkAlternate = $document->createElementNS(self::ATOM_NS, 'link'); - $channel->appendChild($linkAlternate); - $linkAlternate->setAttribute('rel', 'alternate'); - $linkAlternate->setAttribute('type', 'text/html'); - $linkAlternate->setAttribute('href', $uri); - - $linkSelf = $document->createElementNS(self::ATOM_NS, 'link'); - $channel->appendChild($linkSelf); - $linkSelf->setAttribute('rel', 'self'); - $linkSelf->setAttribute('type', 'application/atom+xml'); - $linkSelf->setAttribute('href', $feedUrl); + foreach ($feedArray as $feedKey => $feedValue) { + if (in_array($feedKey, ['atom', 'donationUri'])) { + continue; + } + if ($feedKey === 'name') { + $channelTitle = $document->createElement('title'); + $channel->appendChild($channelTitle); + $channelTitle->appendChild($document->createTextNode($title)); + + $description = $document->createElement('description'); + $channel->appendChild($description); + $description->appendChild($document->createTextNode($title)); + } elseif ($feedKey === 'uri') { + $link = $document->createElement('link'); + $channel->appendChild($link); + $link->appendChild($document->createTextNode($uri)); + + $linkAlternate = $document->createElementNS(self::ATOM_NS, 'link'); + $channel->appendChild($linkAlternate); + $linkAlternate->setAttribute('rel', 'alternate'); + $linkAlternate->setAttribute('type', 'text/html'); + $linkAlternate->setAttribute('href', $uri); + + $linkSelf = $document->createElementNS(self::ATOM_NS, 'link'); + $channel->appendChild($linkSelf); + $linkSelf->setAttribute('rel', 'self'); + $linkSelf->setAttribute('type', 'application/atom+xml'); + $feedUrl = get_current_url(); + $linkSelf->setAttribute('href', $feedUrl); + } elseif ($feedKey === 'icon') { + $allowedIconExtensions = [ + '.gif', + '.jpg', + '.png', + '.ico', + ]; + $icon = $feedValue; + if ($icon && in_array(substr($icon, -4), $allowedIconExtensions)) { + $feedImage = $document->createElement('image'); + $channel->appendChild($feedImage); + $iconUrl = $document->createElement('url'); + $iconUrl->appendChild($document->createTextNode($icon)); + $feedImage->appendChild($iconUrl); + $iconTitle = $document->createElement('title'); + $iconTitle->appendChild($document->createTextNode($title)); + $feedImage->appendChild($iconTitle); + $iconLink = $document->createElement('link'); + $iconLink->appendChild($document->createTextNode($uri)); + $feedImage->appendChild($iconLink); + } + } elseif ($feedKey === 'itunes') { + $feed->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:itunes', self::ITUNES_NS); + foreach ($feedValue as $itunesKey => $itunesValue) { + $itunesProperty = $document->createElementNS(self::ITUNES_NS, $itunesKey); + $channel->appendChild($itunesProperty); + $itunesProperty->appendChild($document->createTextNode($itunesValue)); + } + } else { + $element = $document->createElement($feedKey); + $channel->appendChild($element); + $element->appendChild($document->createTextNode($feedValue)); + } + } foreach ($this->getItems() as $item) { $itemArray = $item->toArray(); @@ -135,6 +150,7 @@ public function stringify() $entry->appendChild($itunesProperty); $itunesProperty->appendChild($document->createTextNode($itunesValue)); } + if (isset($itemArray['enclosure'])) { $itunesEnclosure = $document->createElement('enclosure'); $entry->appendChild($itunesEnclosure); @@ -142,7 +158,9 @@ public function stringify() $itunesEnclosure->setAttribute('length', $itemArray['enclosure']['length']); $itunesEnclosure->setAttribute('type', $itemArray['enclosure']['type']); } - } if (!empty($itemUri)) { + } + + if (!empty($itemUri)) { $entryLink = $document->createElement('link'); $entry->appendChild($entryLink); $entryLink->appendChild($document->createTextNode($itemUri)); diff --git a/formats/PlaintextFormat.php b/formats/PlaintextFormat.php index 0a9237d04a9..4e18caa6058 100644 --- a/formats/PlaintextFormat.php +++ b/formats/PlaintextFormat.php @@ -6,11 +6,11 @@ class PlaintextFormat extends FormatAbstract public function stringify() { - $data = []; + $feed = $this->getFeed(); foreach ($this->getItems() as $item) { - $data[] = $item->toArray(); + $feed['items'][] = $item->toArray(); } - $text = print_r($data, true); + $text = print_r($feed, true); // Remove invalid non-UTF8 characters ini_set('mbstring.substitute_character', 'none'); $text = mb_convert_encoding($text, $this->getCharset(), 'UTF-8'); diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php index 0f86f454c0d..8001ba4fba4 100644 --- a/lib/BridgeAbstract.php +++ b/lib/BridgeAbstract.php @@ -40,49 +40,66 @@ public function __construct( abstract public function collectData(); - public function getItems() + public function getFeed(): array { - return $this->items; + return [ + 'name' => $this->getName(), + 'uri' => $this->getURI(), + 'donationUri' => $this->getDonationURI(), + 'icon' => $this->getIcon(), + ]; } - public function getOption(string $name) + public function getName() { - return $this->configuration[$name] ?? null; + return static::NAME; } - public function getDescription() + public function getURI() { - return static::DESCRIPTION; + return static::URI ?? 'https://github.com/RSS-Bridge/rss-bridge/'; } - public function getMaintainer(): string + public function getDonationURI(): string { - return static::MAINTAINER; + return static::DONATION_URI; } - public function getName() + public function getIcon() { - return static::NAME; + if (static::URI) { + // This favicon may or may not exist + return rtrim(static::URI, '/') . '/favicon.ico'; + } + return ''; } - public function getIcon() + public function getOption(string $name) { - return static::URI . '/favicon.ico'; + return $this->configuration[$name] ?? null; } - public function getParameters(): array + /** + * The description is currently not used in feed production + */ + public function getDescription() { - return static::PARAMETERS; + return static::DESCRIPTION; } - public function getURI() + public function getMaintainer(): string { - return static::URI; + return static::MAINTAINER; } - public function getDonationURI(): string + public function getParameters(): array { - return static::DONATION_URI; + return static::PARAMETERS; + } + + public function getItems() + { + return $this->items; } public function getCacheTimeout() diff --git a/lib/FormatAbstract.php b/lib/FormatAbstract.php index c76d1e42166..28eb4bbfa7a 100644 --- a/lib/FormatAbstract.php +++ b/lib/FormatAbstract.php @@ -9,28 +9,25 @@ abstract class FormatAbstract protected string $charset = 'UTF-8'; protected array $items = []; protected int $lastModified; - protected array $extraInfos = []; - abstract public function stringify(); - - public function getMimeType(): string - { - return static::MIME_TYPE; - } + protected array $feed = []; - public function setCharset(string $charset) - { - $this->charset = $charset; - } + abstract public function stringify(); - public function getCharset(): string + public function setFeed(array $feed) { - return $this->charset; + $default = [ + 'name' => '', + 'uri' => '', + 'icon' => '', + 'donationUri' => '', + ]; + $this->feed = array_merge($default, $feed); } - public function setLastModified(int $lastModified) + public function getFeed(): array { - $this->lastModified = $lastModified; + return $this->feed; } /** @@ -49,27 +46,23 @@ public function getItems(): array return $this->items; } - public function setExtraInfos(array $infos = []) + public function getMimeType(): string { - $extras = [ - 'name', - 'uri', - 'icon', - 'donationUri', - ]; - foreach ($extras as $extra) { - if (!isset($infos[$extra])) { - $infos[$extra] = ''; - } - } - $this->extraInfos = $infos; + return static::MIME_TYPE; } - public function getExtraInfos(): array + public function setCharset(string $charset) { - if (!$this->extraInfos) { - $this->setExtraInfos(); - } - return $this->extraInfos; + $this->charset = $charset; + } + + public function getCharset(): string + { + return $this->charset; + } + + public function setLastModified(int $lastModified) + { + $this->lastModified = $lastModified; } } diff --git a/lib/bootstrap.php b/lib/bootstrap.php index a95de9dd0ef..85d823e92c1 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -9,9 +9,6 @@ /** Path to the cache folder */ const PATH_CACHE = __DIR__ . '/../cache/'; -/** URL to the RSS-Bridge repository */ -const REPOSITORY = 'https://github.com/RSS-Bridge/rss-bridge/'; - // Allow larger files for simple_html_dom // todo: extract to config (if possible) const MAX_FILE_SIZE = 10000000; diff --git a/tests/FormatTest.php b/tests/FormatTest.php new file mode 100644 index 00000000000..b5df395cccd --- /dev/null +++ b/tests/FormatTest.php @@ -0,0 +1,72 @@ + '', + 'uri' => '', + 'icon' => '', + 'donationUri' => '', + ]; + $this->assertEquals([], $sut->getFeed()); + + $sut->setFeed([ + 'name' => '0', + 'uri' => '1', + 'icon' => '2', + 'donationUri' => '3', + ]); + $expected = [ + 'name' => '0', + 'uri' => '1', + 'icon' => '2', + 'donationUri' => '3', + ]; + $this->assertEquals($expected, $sut->getFeed()); + + $sut->setFeed([]); + $expected = [ + 'name' => '', + 'uri' => '', + 'icon' => '', + 'donationUri' => '', + ]; + $this->assertEquals($expected, $sut->getFeed()); + + $sut->setFeed(['foo' => 'bar', 'foo2' => 'bar2']); + $expected = [ + 'name' => '', + 'uri' => '', + 'icon' => '', + 'donationUri' => '', + 'foo' => 'bar', + 'foo2' => 'bar2', + ]; + $this->assertEquals($expected, $sut->getFeed()); + } +} + +class TestFormat extends \FormatAbstract +{ + public function stringify() + { + } +} + +class TestBridge extends \BridgeAbstract +{ + public function collectData() + { + $this->items[] = ['title' => 'kek']; + } +} diff --git a/tests/Formats/BaseFormatTest.php b/tests/Formats/BaseFormatTest.php index 71e196f0260..8999e7722af 100644 --- a/tests/Formats/BaseFormatTest.php +++ b/tests/Formats/BaseFormatTest.php @@ -61,7 +61,7 @@ protected function formatData(string $formatName, \stdClass $sample): string $formatFactory = new FormatFactory(); $format = $formatFactory->create($formatName); $format->setItems($sample->items); - $format->setExtraInfos($sample->meta); + $format->setFeed($sample->meta); $format->setLastModified(strtotime('2000-01-01 12:00:00 UTC')); return $format->stringify(); diff --git a/tests/Formats/samples/expectedAtomFormat/feed.common.xml b/tests/Formats/samples/expectedAtomFormat/feed.common.xml index aa6d0687da2..455e5440529 100644 --- a/tests/Formats/samples/expectedAtomFormat/feed.common.xml +++ b/tests/Formats/samples/expectedAtomFormat/feed.common.xml @@ -2,15 +2,15 @@ Sample feed with common data - https://example.com/feed?type=common&items=4 + + https://example.com/logo.png https://example.com/logo.png + https://example.com/feed?type=common&items=4 2000-01-01T12:00:00+00:00 RSS-Bridge - - Test Entry diff --git a/tests/Formats/samples/expectedAtomFormat/feed.empty.xml b/tests/Formats/samples/expectedAtomFormat/feed.empty.xml index fc04304da51..083f230f9bf 100644 --- a/tests/Formats/samples/expectedAtomFormat/feed.empty.xml +++ b/tests/Formats/samples/expectedAtomFormat/feed.empty.xml @@ -2,14 +2,12 @@ Sample feed with minimum data + + https://example.com/feed - https://github.com/favicon.ico - https://github.com/favicon.ico 2000-01-01T12:00:00+00:00 RSS-Bridge - - diff --git a/tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml b/tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml index 18572fac4f8..d7cb461a1e6 100644 --- a/tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml +++ b/tests/Formats/samples/expectedAtomFormat/feed.emptyItems.xml @@ -2,15 +2,13 @@ Sample feed with minimum data + + https://example.com/feed - https://github.com/favicon.ico - https://github.com/favicon.ico 2000-01-01T12:00:00+00:00 RSS-Bridge - - Sample Item #1 diff --git a/tests/Formats/samples/expectedAtomFormat/feed.microblog.xml b/tests/Formats/samples/expectedAtomFormat/feed.microblog.xml index 32bc02731e7..8eb0133c83a 100644 --- a/tests/Formats/samples/expectedAtomFormat/feed.microblog.xml +++ b/tests/Formats/samples/expectedAtomFormat/feed.microblog.xml @@ -2,15 +2,15 @@ Sample microblog feed - https://example.com/feed + + https://example.com/logo.png https://example.com/logo.png + https://example.com/feed 2000-01-01T12:00:00+00:00 RSS-Bridge - - Oh 😲 I found three monkeys 🙈🙉🙊 diff --git a/tests/Formats/samples/expectedMrssFormat/feed.common.xml b/tests/Formats/samples/expectedMrssFormat/feed.common.xml index 38a16f88afc..92838ae883e 100644 --- a/tests/Formats/samples/expectedMrssFormat/feed.common.xml +++ b/tests/Formats/samples/expectedMrssFormat/feed.common.xml @@ -2,15 +2,15 @@ Sample feed with common data - https://example.com/blog/ Sample feed with common data + https://example.com/blog/ + + https://example.com/logo.png Sample feed with common data https://example.com/blog/ - - Test Entry diff --git a/tests/Formats/samples/expectedMrssFormat/feed.empty.xml b/tests/Formats/samples/expectedMrssFormat/feed.empty.xml index 888c42b6cf0..40eecfc6ff9 100644 --- a/tests/Formats/samples/expectedMrssFormat/feed.empty.xml +++ b/tests/Formats/samples/expectedMrssFormat/feed.empty.xml @@ -2,8 +2,8 @@ Sample feed with minimum data - https://github.com/RSS-Bridge/rss-bridge/ Sample feed with minimum data + https://github.com/RSS-Bridge/rss-bridge/ diff --git a/tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml b/tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml index 9e712ddd998..8839f5a5918 100644 --- a/tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml +++ b/tests/Formats/samples/expectedMrssFormat/feed.emptyItems.xml @@ -2,8 +2,8 @@ Sample feed with minimum data - https://github.com/RSS-Bridge/rss-bridge/ Sample feed with minimum data + https://github.com/RSS-Bridge/rss-bridge/ diff --git a/tests/Formats/samples/expectedMrssFormat/feed.microblog.xml b/tests/Formats/samples/expectedMrssFormat/feed.microblog.xml index 81dac87a793..63c04c0f420 100644 --- a/tests/Formats/samples/expectedMrssFormat/feed.microblog.xml +++ b/tests/Formats/samples/expectedMrssFormat/feed.microblog.xml @@ -2,15 +2,15 @@ Sample microblog feed - https://example.com/blog/ Sample microblog feed + https://example.com/blog/ + + https://example.com/logo.png Sample microblog feed https://example.com/blog/ - - 1918f084648b82057c1dd3faa3d091da82a6fac2 diff --git a/tests/Formats/samples/feed.empty.json b/tests/Formats/samples/feed.empty.json index aac09f64994..7b1a2eae54d 100644 --- a/tests/Formats/samples/feed.empty.json +++ b/tests/Formats/samples/feed.empty.json @@ -6,7 +6,7 @@ }, "meta": { "name": "Sample feed with minimum data", - "uri": "", + "uri": "https://github.com/RSS-Bridge/rss-bridge/", "icon": "" }, "items": [] diff --git a/tests/Formats/samples/feed.emptyItems.json b/tests/Formats/samples/feed.emptyItems.json index 0287d428917..4d0774875e2 100644 --- a/tests/Formats/samples/feed.emptyItems.json +++ b/tests/Formats/samples/feed.emptyItems.json @@ -6,7 +6,7 @@ }, "meta": { "name": "Sample feed with minimum data", - "uri": "", + "uri": "https://github.com/RSS-Bridge/rss-bridge/", "icon": "" }, "items": [