mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2025-10-26 13:13:08 +01:00
✅ Add new exceptions
This commit is contained in:
29
tests/ExceptionTest.php
Normal file
29
tests/ExceptionTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Shikiryu\SRSS\Exception\ChannelNotFoundInRSSException;
|
||||
use Shikiryu\SRSS\Exception\PropertyNotFoundException;
|
||||
use Shikiryu\SRSS\Exception\UnreadableRSSException;
|
||||
use Shikiryu\SRSS\SRSS;
|
||||
|
||||
class ExceptionTest extends TestCase
|
||||
{
|
||||
public function testPropertyNotFound()
|
||||
{
|
||||
$srss = new SRSS();
|
||||
$this->expectException(PropertyNotFoundException::class);
|
||||
$srss->notfound = 'true';
|
||||
}
|
||||
|
||||
public function testRssNotFound()
|
||||
{
|
||||
$this->expectException(UnreadableRSSException::class);
|
||||
$rss = SRSS::read('not_found.xml');
|
||||
}
|
||||
|
||||
public function testMissingChannel()
|
||||
{
|
||||
$this->expectException(ChannelNotFoundInRSSException::class);
|
||||
$rss = SRSS::read(__DIR__ . '/resources/invalid-no-channel.xml');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user