Esempio n. 1
0
 public function testShouldAllowPopulationFromJson()
 {
     $data = array('identifier' => 'id', 'label' => 'title', 'items' => array(array('id' => 1, 'title' => 'One', 'name' => 'First'), array('id' => 2, 'title' => 'Two', 'name' => 'Second'), array('id' => 3, 'title' => 'Three', 'name' => 'Third'), array('id' => 4, 'title' => 'Four', 'name' => 'Fourth')));
     $json = Json::encode($data);
     $dojoData = new DojoData();
     $dojoData->fromJson($json);
     $test = $dojoData->toArray();
     $this->assertEquals($data, $test);
 }