You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
906 B
31 lines
906 B
4 years ago
|
<?php
|
||
|
/** @license MIT
|
||
|
* Copyright 2018 J. King
|
||
|
* See LICENSE and AUTHORS files for details */
|
||
|
|
||
|
declare(strict_types=1);
|
||
4 years ago
|
namespace MensBeam\Lax\TestCase\Parser;
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @covers MensBeam\Lax\Parser\XML\Feed<extended>
|
||
|
* @covers MensBeam\Lax\Parser\XML\Entry<extended>
|
||
4 years ago
|
* @covers MensBeam\Lax\Parser\XML\XPath
|
||
4 years ago
|
*/
|
||
4 years ago
|
class XMLTest extends AbstractParserTestCase {
|
||
4 years ago
|
/** @dataProvider provideXML */
|
||
|
public function testParseAnXmlFeed(string $input, string $type, ?string $url, $exp): void {
|
||
|
$p = new \MensBeam\Lax\Parser\XML\Feed($input, $type, $url);
|
||
|
if ($exp instanceof \Exception) {
|
||
|
$this->expectExceptionObject($exp);
|
||
|
$p->parse();
|
||
|
} else {
|
||
|
$act = $p->parse();
|
||
|
$this->assertEquals($exp, $act);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function provideXML(): iterable {
|
||
4 years ago
|
return $this->provideParserTests(__DIR__."/XML/*.yaml");
|
||
4 years ago
|
}
|
||
|
}
|