2015-09-17 23:11:18 -04:00
|
|
|
<?php
|
|
|
|
|
2015-10-09 22:29:59 -04:00
|
|
|
use Aviat\AnimeClient\Hummingbird\Transformer\MangaListsZipper;
|
2015-09-17 23:11:18 -04:00
|
|
|
|
|
|
|
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-25 13:41:12 -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-18 13:06:22 -04:00
|
|
|
|
2016-01-06 15:44:40 -05:00
|
|
|
$json = json_file_decode($this->start_file);
|
2015-09-17 23:11:18 -04:00
|
|
|
$this->mangaListsZipper = new MangaListsZipper($json);
|
|
|
|
}
|
2015-09-18 13:06:22 -04:00
|
|
|
|
2015-09-17 23:11:18 -04:00
|
|
|
public function testTransform()
|
|
|
|
{
|
2016-01-06 15:44:40 -05:00
|
|
|
$zippered_json = json_file_decode($this->res_file);
|
2015-09-17 23:11:18 -04:00
|
|
|
$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
|
|
|
}
|