mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2025-10-27 01:23:07 +01:00
🚨 Clean code for linters
This commit is contained in:
@@ -16,7 +16,7 @@ class BasicBuilderTest extends TestCase
|
||||
unlink($this->saved);
|
||||
}
|
||||
}
|
||||
public function testCreateBasicRSS()
|
||||
public function testCreateBasicRSS(): void
|
||||
{
|
||||
$srss = SRSS::create();
|
||||
$srss->title = 'My Blog';
|
||||
|
||||
@@ -9,7 +9,7 @@ use Shikiryu\SRSS\SRSS;
|
||||
|
||||
class BasicReaderTest extends TestCase
|
||||
{
|
||||
public function testReadBasicRSS()
|
||||
public function testReadBasicRSS(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/basic.xml');
|
||||
self::assertEquals('test Home Page', $rss->title);
|
||||
@@ -20,7 +20,7 @@ class BasicReaderTest extends TestCase
|
||||
self::assertTrue($rss->isValid());
|
||||
}
|
||||
|
||||
public function testSpecificationExampleRSS()
|
||||
public function testSpecificationExampleRSS(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/harvard.xml');
|
||||
self::assertEquals('Liftoff News', $rss->title);
|
||||
@@ -41,7 +41,7 @@ class BasicReaderTest extends TestCase
|
||||
self::assertTrue($rss->isValid());
|
||||
}
|
||||
|
||||
public function testChannelImage()
|
||||
public function testChannelImage(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/media/cnn.xml');
|
||||
$image = $rss->image;
|
||||
@@ -51,7 +51,7 @@ class BasicReaderTest extends TestCase
|
||||
self::assertEquals('https://www.cnn.com/entertainment/index.html', $image->link, var_export($image, true));
|
||||
}
|
||||
|
||||
public function testChannelCategory()
|
||||
public function testChannelCategory(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/cloud.xml');
|
||||
$categories = $rss->category;
|
||||
@@ -62,7 +62,7 @@ class BasicReaderTest extends TestCase
|
||||
self::assertEquals('rssUpdates', $category->value, var_export($category, true));
|
||||
}
|
||||
|
||||
public function testCloud()
|
||||
public function testCloud(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/cloud.xml');
|
||||
$cloud = $rss->cloud;
|
||||
@@ -74,7 +74,7 @@ class BasicReaderTest extends TestCase
|
||||
self::assertEquals('xml-rpc', $cloud->protocol, var_export($cloud, true));
|
||||
}
|
||||
|
||||
public function testSource()
|
||||
public function testSource(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/basic.xml');
|
||||
$firstItem = $rss->getFirst();
|
||||
@@ -85,7 +85,7 @@ class BasicReaderTest extends TestCase
|
||||
self::assertEquals('Tomalak\'s Realm', $source->value);
|
||||
}
|
||||
|
||||
public function testEnclosure()
|
||||
public function testEnclosure(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/basic.xml');
|
||||
$item = $rss->getItem(2);
|
||||
|
||||
@@ -8,22 +8,22 @@ use Shikiryu\SRSS\SRSS;
|
||||
|
||||
class ExceptionTest extends TestCase
|
||||
{
|
||||
public function testPropertyNotFound()
|
||||
public function testPropertyNotFound(): void
|
||||
{
|
||||
$srss = new SRSS();
|
||||
$this->expectException(PropertyNotFoundException::class);
|
||||
$srss->notfound = 'true';
|
||||
}
|
||||
|
||||
public function testRssNotFound()
|
||||
public function testRssNotFound(): void
|
||||
{
|
||||
$this->expectException(UnreadableRSSException::class);
|
||||
$rss = SRSS::read('not_found.xml');
|
||||
SRSS::read('not_found.xml');
|
||||
}
|
||||
|
||||
public function testMissingChannel()
|
||||
public function testMissingChannel(): void
|
||||
{
|
||||
$this->expectException(ChannelNotFoundInRSSException::class);
|
||||
$rss = SRSS::read(__DIR__ . '/resources/invalid-no-channel.xml');
|
||||
SRSS::read(__DIR__ . '/resources/invalid-no-channel.xml');
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ use Shikiryu\SRSS\SRSS;
|
||||
|
||||
class MediaTest extends TestCase
|
||||
{
|
||||
public function testImages()
|
||||
public function testImages(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/media/cnn.xml');
|
||||
self::assertEquals('CNN.com - RSS Channel - Entertainment', $rss->title);
|
||||
@@ -17,7 +17,7 @@ class MediaTest extends TestCase
|
||||
self::assertTrue($rss->isValid(), var_export($rss->channel->validated, true));
|
||||
}
|
||||
|
||||
public function testMusicVideo()
|
||||
public function testMusicVideo(): void
|
||||
{
|
||||
$rss = SRSS::read(__DIR__.'/resources/media/music-video.xml');
|
||||
self::assertEquals('Music Videos 101', $rss->title);
|
||||
|
||||
@@ -16,7 +16,7 @@ class OriginalReaderSRSSTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testOriginalReader()
|
||||
public function testOriginalReader(): void
|
||||
{
|
||||
$rss = SRSS::read($this->original);
|
||||
self::assertEquals('Liftoff News', $rss->title);
|
||||
|
||||
@@ -7,7 +7,7 @@ use Shikiryu\SRSS\SRSSTools;
|
||||
|
||||
class OriginalWriterSRSSTest extends TestCase
|
||||
{
|
||||
public function testOriginalWriter()
|
||||
public function testOriginalWriter(): void
|
||||
{
|
||||
$rss = SRSS::create();
|
||||
$rss->title = 'My Awesome Blog';
|
||||
@@ -22,12 +22,12 @@ class OriginalWriterSRSSTest extends TestCase
|
||||
];
|
||||
|
||||
foreach($items as $item){
|
||||
$rssitem = new Item();
|
||||
$rssitem->title = $item["title"];
|
||||
$rssitem->link = $item['link'];
|
||||
$rssitem->pubDate = $item["pubDate"];
|
||||
$rssitem->description = $item["description"];
|
||||
$rss->addItem($rssitem);
|
||||
$rss_item = new Item();
|
||||
$rss_item->title = $item["title"];
|
||||
$rss_item->link = $item['link'];
|
||||
$rss_item->pubDate = $item["pubDate"];
|
||||
$rss_item->description = $item["description"];
|
||||
$rss->addItem($rss_item);
|
||||
}
|
||||
|
||||
$firstItem = new Item();
|
||||
|
||||
Reference in New Issue
Block a user