Exemplo n.º 1
0
 public function testPassingOptionsToConstructorShouldSetObjectState()
 {
     $options = array('name' => 'foo.bar', 'callback' => array('function' => 'foo', 'type' => 'function'), 'prototypes' => array(array('returnType' => 'struct', 'parameters' => array('string', 'array'))), 'methodHelp' => 'foo bar', 'object' => new \stdClass(), 'invokeArguments' => array('foo', array('bar', 'baz')));
     $definition = new Method\Definition($options);
     $test = $definition->toArray();
     $this->assertEquals($options['name'], $test['name']);
     $this->assertEquals($options['callback'], $test['callback']);
     $this->assertEquals($options['prototypes'], $test['prototypes']);
     $this->assertEquals($options['methodHelp'], $test['methodHelp']);
     $this->assertEquals($options['object'], $test['object']);
     $this->assertEquals($options['invokeArguments'], $test['invokeArguments']);
 }
Exemplo n.º 2
0
 /**
  * Serialize to array.
  *
  * @return array
  */
 public function toArray()
 {
     return parent::toArray() + array('nameSm' => $this->getNameSm());
 }