Browse Source

always return arrays for photo and audio from XML feeds

pull/49/head v1.4.1
Aaron Parecki 7 years ago
parent
commit
65d36a74de
No known key found for this signature in database GPG Key ID: 276C2817346D6056
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      lib/XRay/Formats/XML.php
  2. +1
    -1
      tests/FeedTest.php

+ 1
- 1
lib/XRay/Formats/XML.php View File

@ -88,7 +88,7 @@ class XML extends Format {
$prop = 'photo'; break; $prop = 'photo'; break;
} }
if($prop) if($prop)
$entry[$prop] = $item->getEnclosureUrl();
$entry[$prop] = [$item->getEnclosureUrl()];
} }
return $entry; return $entry;

+ 1
- 1
tests/FeedTest.php View File

@ -287,7 +287,7 @@ class FeedTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('Episode 1: Welcome', $data->items[11]->name); $this->assertEquals('Episode 1: Welcome', $data->items[11]->name);
$this->assertEquals('https://percolator.today/episode/1', $data->items[11]->url); $this->assertEquals('https://percolator.today/episode/1', $data->items[11]->url);
$this->assertEquals('2017-09-20T07:00:00+00:00', $data->items[11]->published); $this->assertEquals('2017-09-20T07:00:00+00:00', $data->items[11]->published);
$this->assertEquals('https://percolator.today/redirect.php?url=https%3A%2F%2Fpercolator.today%2Fmedia%2FPercolator_Episode_1.mp3', $data->items[11]->audio);
$this->assertEquals('https://percolator.today/redirect.php?url=https%3A%2F%2Fpercolator.today%2Fmedia%2FPercolator_Episode_1.mp3', $data->items[11]->audio[0]);
$this->assertContains('What is Percolator? Some thoughts about multi-photos in Instagram.', $data->items[11]->content->text); $this->assertContains('What is Percolator? Some thoughts about multi-photos in Instagram.', $data->items[11]->content->text);
$this->assertContains('What is Percolator? Some thoughts about multi-photos in Instagram.', $data->items[11]->content->html); $this->assertContains('What is Percolator? Some thoughts about multi-photos in Instagram.', $data->items[11]->content->html);
$this->assertContains('<li><a href="https://indieweb.org/multi-photo_vs_collection">multi-photo vs collection</a></li>', $data->items[11]->content->html); $this->assertContains('<li><a href="https://indieweb.org/multi-photo_vs_collection">multi-photo vs collection</a></li>', $data->items[11]->content->html);

Loading…
Cancel
Save