Example #1
0
 public function testSimpleClassConversion()
 {
     $o = new SimpleClass();
     $o->setName("test");
     $o->setDescription("description");
     $this->assertEquals("test", $o->getName());
     $this->assertEquals("description", $o->getDescription());
     $json = $o->toJSON();
     $this->assertEquals('{"name":"test","desc":"description"}', $json);
     $newO = new SimpleClass();
     $newO->fromJson($json);
     $this->assertEquals($o, $newO);
 }