public function getCatalog() { $json = __DIR__ . '/../catalog.json'; $array = json_decode(file_get_contents($json), true); $catalog = new Catalog(); $catalog->import($array); return $catalog; }
public function testImport() { $json = __DIR__ . '/../catalog.json'; $array = json_decode(file_get_contents($json), true); $catalog = new Catalog(); $catalog->import($array); //file_put_contents($json, json_encode($catalog, \JSON_PRETTY_PRINT)); $this->assertEquals($array, $catalog->toArray()); }