1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2024-11-15 06:28:50 +01:00
ShikiryuRSS/tests/ExceptionTest.php

29 lines
813 B
PHP
Raw Normal View History

2023-04-12 00:27:35 +02:00
<?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
{
2023-04-12 15:28:38 +02:00
public function testPropertyNotFound(): void
2023-04-12 00:27:35 +02:00
{
$srss = new SRSS();
$this->expectException(PropertyNotFoundException::class);
$srss->notfound = 'true';
}
2023-04-12 15:28:38 +02:00
public function testRssNotFound(): void
2023-04-12 00:27:35 +02:00
{
$this->expectException(UnreadableRSSException::class);
2023-04-12 15:28:38 +02:00
SRSS::read('not_found.xml');
2023-04-12 00:27:35 +02:00
}
2023-04-12 15:28:38 +02:00
public function testMissingChannel(): void
2023-04-12 00:27:35 +02:00
{
$this->expectException(ChannelNotFoundInRSSException::class);
2023-04-12 15:28:38 +02:00
SRSS::read(__DIR__ . '/resources/invalid-no-channel.xml');
2023-04-12 00:27:35 +02:00
}
}