Пример #1
0
 public function testPassingOptionsToConstructorShouldSetObjectState()
 {
     $method = array('name' => 'foo.bar', 'callback' => array('type' => 'function', 'function' => 'bar'), 'prototypes' => array(array('returnType' => 'string', 'parameters' => array('string'))), 'methodHelp' => 'Foo Bar!', 'invokeArguments' => array('foo'));
     $options = array($method);
     $definition = new Server\Definition($options);
     $test = $definition->toArray();
     $this->assertEquals(1, count($test));
     $test = array_shift($test);
     $this->assertEquals($method['name'], $test['name']);
     $this->assertEquals($method['methodHelp'], $test['methodHelp']);
     $this->assertEquals($method['invokeArguments'], $test['invokeArguments']);
     $this->assertEquals($method['prototypes'][0]['returnType'], $test['prototypes'][0]['returnType']);
 }
Пример #2
0
 /**
  * Returns a list of registered methods
  *
  * Returns an array of dispatchables (Zend\Server\Reflection\ReflectionFunction,
  * ReflectionMethod, and ReflectionClass items).
  *
  * @return array
  */
 public function getFunctions()
 {
     return $this->table->toArray();
 }