예제 #1
0
 public function testPersistsCustomAttributes()
 {
     $data = array('operations' => array('foo' => array('class' => 'foo', 'parameters' => array())), 'name' => 'Name', 'description' => 'Test', 'apiVersion' => '1.24', 'auth' => 'foo', 'keyParam' => 'bar');
     $d = new ServiceDescription($data);
     $d->setData('hello', 'baz');
     $this->assertEquals('foo', $d->getData('auth'));
     $this->assertEquals('baz', $d->getData('hello'));
     $this->assertEquals('bar', $d->getData('keyParam'));
     // responseClass and responseType are added by default
     $data['operations']['foo']['responseClass'] = 'array';
     $data['operations']['foo']['responseType'] = 'primitive';
     $this->assertEquals($data + array('hello' => 'baz'), json_decode($d->serialize(), true));
 }