diff --git a/tests/ItchTest.php b/tests/ItchTest.php index e7a8c5f..f8984f2 100644 --- a/tests/ItchTest.php +++ b/tests/ItchTest.php @@ -38,8 +38,9 @@ class ItchTest extends TestCase } public function testPageParsing() { + // we trick parser to think the page is online but we parse an offline copy $url = 'https://zarf.itch.io/spider-and-web'; - $game_page = $this->parser->get_text($url); + $game_page = file_get_contents('./tests/fixtures/itch_test_1.html'); $this->parser->loadStr($game_page, []); $game = $this->parser->page($url); $this->assertSame($game->url, $url); diff --git a/tests/fixtures/itch_test_1.html b/tests/fixtures/itch_test_1.html new file mode 100644 index 0000000..634f275 --- /dev/null +++ b/tests/fixtures/itch_test_1.html @@ -0,0 +1,12 @@ + +Spider And Web by zarf
Published Jul 18, 2014
StatusReleased
PlatformsHTML5
Rating
(6)
Authorzarf
GenreAdventure, Interactive Fiction
Tagsparser, text, text-adventure, zarf