HummingBirdAnimeClient/tests/AnimeClient/Transformer/MangaListsZipperTest.php

27 lines
724 B
PHP
Raw Normal View History

2015-09-17 23:11:18 -04:00
<?php
use Aviat\AnimeClient\Transformer\Hummingbird\MangaListsZipper;
class MangaListsZipperTest extends AnimeClient_TestCase {
2015-09-18 13:06:22 -04:00
protected $start_file = '';
protected $res_file = '';
2015-09-17 23:11:18 -04:00
public function setUp()
{
2015-09-18 13:06:22 -04:00
$this->start_file = __DIR__ . '/../../test_data/manga_list/manga.json';
$this->res_file = __DIR__ . '/../../test_data/manga_list/manga-zippered.json';
2015-09-17 23:11:18 -04:00
$json = json_decode(file_get_contents($this->start_file), TRUE);
$this->mangaListsZipper = new MangaListsZipper($json);
}
2015-09-18 13:06:22 -04:00
2015-09-17 23:11:18 -04:00
public function testTransform()
{
$zippered_json = json_decode(file_get_contents($this->res_file), TRUE);
$transformed = $this->mangaListsZipper->transform();
2015-09-18 13:06:22 -04:00
2015-09-17 23:11:18 -04:00
$this->assertEquals($zippered_json, $transformed);
}
2015-09-18 13:06:22 -04:00
2015-09-17 23:11:18 -04:00
}