mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-17 14:18:35 +01:00
f421c45b21
* test: add feed item test also some refactor * yup * yup
31 lines
706 B
PHP
31 lines
706 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace RssBridge\Tests;
|
|
|
|
use FeedItem;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class FeedItemTest extends TestCase
|
|
{
|
|
public function test()
|
|
{
|
|
$item = new FeedItem();
|
|
$item->setTitle('hello');
|
|
$this->assertSame('hello', $item->getTitle());
|
|
|
|
$item = FeedItem::fromArray(['title' => 'hello2']);
|
|
$this->assertSame('hello2', $item->getTitle());
|
|
|
|
$item = new FeedItem();
|
|
$item->setAuthor('123');
|
|
$this->assertSame('123', $item->getAuthor());
|
|
|
|
$item = new FeedItem();
|
|
$item->title = 'aa';
|
|
$this->assertSame('aa', $item->getTitle());
|
|
$this->assertSame('aa', $item->title);
|
|
}
|
|
}
|