1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-07 17:17:00 +02:00

test: add feed item test (#3709)

* test: add feed item test

also some refactor

* yup

* yup
This commit is contained in:
Dag
2023-09-25 22:32:15 +02:00
committed by GitHub
parent cd30c25b08
commit f421c45b21
10 changed files with 98 additions and 81 deletions

30
tests/FeedItemTest.php Normal file
View File

@@ -0,0 +1,30 @@
<?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);
}
}