HummingBirdAnimeClient/tests/AnimeClient/Hummingbird/Transformer/MangaListsZipperTest.php

28 lines
710 B
PHP
Raw Normal View History

2015-09-17 23:11:18 -04:00
<?php
2016-01-07 13:45:43 -05:00
use Aviat\Ion\Json;
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-07 13:45:43 -05:00
$json = Json::decodeFile($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-07 13:45:43 -05:00
$zippered_json = Json::decodeFile($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
}