Ejemplo n.º 1
0
 public function getCatalog()
 {
     $json = __DIR__ . '/../catalog.json';
     $array = json_decode(file_get_contents($json), true);
     $catalog = new Catalog();
     $catalog->import($array);
     return $catalog;
 }
Ejemplo n.º 2
0
 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());
 }