1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2025-09-05 13:04:32 +02:00

Add original cases

This commit is contained in:
2023-04-11 14:07:13 +02:00
parent 63d0b03b50
commit 5de5993e2b
6 changed files with 152 additions and 52 deletions

View File

@@ -8,6 +8,14 @@ use Shikiryu\SRSS\SRSSTools;
class BasicBuilderTest extends TestCase
{
private string $saved = __DIR__.'/resources/tmp/build/testCreateBasicRSS.rss';
protected function tearDown(): void
{
parent::tearDown();
if (file_exists($this->saved)) {
unlink($this->saved);
}
}
public function testCreateBasicRSS()
{
$srss = SRSS::create();
@@ -31,10 +39,11 @@ class BasicBuilderTest extends TestCase
self::assertTrue($srss->isValid());
$filepath = __DIR__.'/resources/tmp/build/testCreateBasicRSS.rss';
$builder = new SRSSBuilder();
$builder->build($srss, $filepath);
$builder->build($srss, $this->saved);
self::assertFileExists($filepath);
self::assertFileExists($this->saved);
self::assertIsString($srss->show());
}
}