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']); }
/** * Serialize to array. * * @return array */ public function toArray() { return parent::toArray() + array('nameSm' => $this->getNameSm()); }