1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2025-10-26 13:13:08 +01:00

♻️ Begins to refactor for media

For #4
This commit is contained in:
2023-04-05 14:44:57 +02:00
parent cec917ad02
commit a55b05d734
16 changed files with 4278 additions and 817 deletions

18
tests/MediaTest.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
use PHPUnit\Framework\TestCase;
use Shikiryu\SRSS\SRSS;
class MediaTest extends TestCase
{
public function testImages()
{
$rss = SRSS::read('resources/media/cnn.xml');
self::assertEquals('CNN.com - RSS Channel - Entertainment', $rss->title);
$first_item = $rss->getFirst();
self::assertEquals('Kirstie Alley, \'Cheers\' and \'Veronica\'s Closet\' star, dead at 71', $first_item->title);
self::assertEquals('https://cdn.cnn.com/cnnnext/dam/assets/221205172141-kirstie-alley-2005-super-169.jpg', $first_item->{'media:group'}->{'media:content'}->url);
}
}