rss-bridge/tests/Formats/MrssFormatTest.php
Jan Tojnar 12ddee4054
tests/Formats: Simplify by using a base class (#2779)
There is a lot of redundancy. Let’s not repeat ourselves.

Unfortunately, since we do not install PHPUnit as a project dependency on CI,
it does not use the composer’s PSR-4 autoloader and the tests are unable to find
the `BaseFormatTest` class.

Until we resolve that, let’s load the class explicitly.
2022-06-08 02:17:32 +02:00

28 lines
731 B
PHP

<?php
/**
* MrssFormat - RSS 2.0 + Media RSS
* http://www.rssboard.org/rss-specification
* http://www.rssboard.org/media-rss
*/
namespace RssBridge\Tests\Formats;
require_once __DIR__ . '/BaseFormatTest.php';
use PHPUnit\Framework\TestCase;
class MrssFormatTest extends BaseFormatTest {
private const PATH_EXPECTED = self::PATH_SAMPLES . 'expectedMrssFormat/';
/**
* @dataProvider sampleProvider
* @runInSeparateProcess
*/
public function testOutput(string $name, string $path) {
$data = $this->formatData('Mrss', $this->loadSample($path));
$this->assertNotFalse(simplexml_load_string($data));
$expected = self::PATH_EXPECTED . $name . '.xml';
$this->assertXmlStringEqualsXmlFile($expected, $data);
}
}