Browse Source

Re-organize parser tests

master
J. King 4 years ago
parent
commit
8d14729797
  1. 2
      tests/cases/Parser/AbstractParserTestCase.php
  2. 0
      tests/cases/Parser/HTTP/http.yaml
  3. 6
      tests/cases/Parser/HTTPTest.php
  4. 0
      tests/cases/Parser/JSON/entry.yaml
  5. 0
      tests/cases/Parser/JSON/failures.yaml
  6. 0
      tests/cases/Parser/JSON/feed.yaml
  7. 6
      tests/cases/Parser/JSONTest.php
  8. 0
      tests/cases/Parser/XML/entry-atom.yaml
  9. 0
      tests/cases/Parser/XML/entry-mixed.yaml
  10. 0
      tests/cases/Parser/XML/entry-other.yaml
  11. 0
      tests/cases/Parser/XML/entry-rss1.yaml
  12. 0
      tests/cases/Parser/XML/entry-rss2.yaml
  13. 0
      tests/cases/Parser/XML/failures.yaml
  14. 0
      tests/cases/Parser/XML/feed-atom.yaml
  15. 0
      tests/cases/Parser/XML/feed-mixed.yaml
  16. 0
      tests/cases/Parser/XML/feed-other.yaml
  17. 0
      tests/cases/Parser/XML/feed-rss0.yaml
  18. 0
      tests/cases/Parser/XML/feed-rss1.yaml
  19. 0
      tests/cases/Parser/XML/feed-rss2.yaml
  20. 6
      tests/cases/Parser/XMLTest.php
  21. 10
      tests/phpunit.dist.xml

2
tests/cases/AbstractParserTestCase.php → tests/cases/Parser/AbstractParserTestCase.php

@ -4,7 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace MensBeam\Lax\TestCase;
namespace MensBeam\Lax\TestCase\Parser;
use MensBeam\Lax\Feed;
use MensBeam\Lax\Date;

0
tests/cases/HTTP/http.yaml → tests/cases/Parser/HTTP/http.yaml

6
tests/cases/HTTP/HTTPTest.php → tests/cases/Parser/HTTPTest.php

@ -4,12 +4,12 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace MensBeam\Lax\TestCase\JSON;
namespace MensBeam\Lax\TestCase\Parser;
use GuzzleHttp\Psr7\Response;
/** @covers MensBeam\Lax\Parser\HTTP\Message */
class HTTPTest extends \MensBeam\Lax\TestCase\AbstractParserTestCase {
class HTTPTest extends AbstractParserTestCase {
/** @dataProvider provideHTTPMessages */
public function testParseAnHttpMessage(Response $input, ?string $url, $exp): void {
$p = new \MensBeam\Lax\Parser\HTTP\Message($input, $url);
@ -23,7 +23,7 @@ class HTTPTest extends \MensBeam\Lax\TestCase\AbstractParserTestCase {
}
public function provideHTTPMessages(): iterable {
foreach ($this->provideParserTests(__DIR__."/*.yaml") as $k => $t) {
foreach ($this->provideParserTests(__DIR__."/HTTP/*.yaml") as $k => $t) {
array_splice($t, 1, 1);
yield $k => $t;
}

0
tests/cases/JSON/entry.yaml → tests/cases/Parser/JSON/entry.yaml

0
tests/cases/JSON/failures.yaml → tests/cases/Parser/JSON/failures.yaml

0
tests/cases/JSON/feed.yaml → tests/cases/Parser/JSON/feed.yaml

6
tests/cases/JSON/JSONTest.php → tests/cases/Parser/JSONTest.php

@ -4,13 +4,13 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace MensBeam\Lax\TestCase\JSON;
namespace MensBeam\Lax\TestCase\Parser;
/**
* @covers MensBeam\Lax\Parser\JSON\Feed<extended>
* @covers MensBeam\Lax\Parser\JSON\Entry<extended>
*/
class JSONTest extends \MensBeam\Lax\TestCase\AbstractParserTestCase {
class JSONTest extends AbstractParserTestCase {
/** @dataProvider provideJSONFeed */
public function testParseAJsonFeed(string $input, string $type, ?string $url, $exp): void {
$p = new \MensBeam\Lax\Parser\JSON\Feed($input, $type, $url);
@ -24,6 +24,6 @@ class JSONTest extends \MensBeam\Lax\TestCase\AbstractParserTestCase {
}
public function provideJSONFeed(): iterable {
return $this->provideParserTests(__DIR__."/*.yaml");
return $this->provideParserTests(__DIR__."/JSON/*.yaml");
}
}

0
tests/cases/XML/entry-atom.yaml → tests/cases/Parser/XML/entry-atom.yaml

0
tests/cases/XML/entry-mixed.yaml → tests/cases/Parser/XML/entry-mixed.yaml

0
tests/cases/XML/entry-other.yaml → tests/cases/Parser/XML/entry-other.yaml

0
tests/cases/XML/entry-rss1.yaml → tests/cases/Parser/XML/entry-rss1.yaml

0
tests/cases/XML/entry-rss2.yaml → tests/cases/Parser/XML/entry-rss2.yaml

0
tests/cases/XML/failures.yaml → tests/cases/Parser/XML/failures.yaml

0
tests/cases/XML/feed-atom.yaml → tests/cases/Parser/XML/feed-atom.yaml

0
tests/cases/XML/feed-mixed.yaml → tests/cases/Parser/XML/feed-mixed.yaml

0
tests/cases/XML/feed-other.yaml → tests/cases/Parser/XML/feed-other.yaml

0
tests/cases/XML/feed-rss0.yaml → tests/cases/Parser/XML/feed-rss0.yaml

0
tests/cases/XML/feed-rss1.yaml → tests/cases/Parser/XML/feed-rss1.yaml

0
tests/cases/XML/feed-rss2.yaml → tests/cases/Parser/XML/feed-rss2.yaml

6
tests/cases/XML/XMLTest.php → tests/cases/Parser/XMLTest.php

@ -4,14 +4,14 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace MensBeam\Lax\TestCase\XML;
namespace MensBeam\Lax\TestCase\Parser;
/**
* @covers MensBeam\Lax\Parser\XML\Feed<extended>
* @covers MensBeam\Lax\Parser\XML\Entry<extended>
* @covers MensBeam\Lax\Parser\XML\XPath
*/
class XMLTest extends \MensBeam\Lax\TestCase\AbstractParserTestCase {
class XMLTest extends AbstractParserTestCase {
/** @dataProvider provideXML */
public function testParseAnXmlFeed(string $input, string $type, ?string $url, $exp): void {
$p = new \MensBeam\Lax\Parser\XML\Feed($input, $type, $url);
@ -25,6 +25,6 @@ class XMLTest extends \MensBeam\Lax\TestCase\AbstractParserTestCase {
}
public function provideXML(): iterable {
return $this->provideParserTests(__DIR__."/*.yaml");
return $this->provideParserTests(__DIR__."/XML/*.yaml");
}
}

10
tests/phpunit.dist.xml

@ -22,14 +22,8 @@
<testsuite name="Util">
<directory>cases/Util</directory>
</testsuite>
<testsuite name="JSON">
<directory>cases/JSON</directory>
</testsuite>
<testsuite name="XML">
<directory>cases/XML</directory>
</testsuite>
<testsuite name="HTTP">
<directory>cases/HTTP</directory>
<testsuite name="Parser">
<directory>cases/Parser</directory>
</testsuite>
</testsuites>
</phpunit>

Loading…
Cancel
Save