/**
  * @expectedException \TSCore\JsonRpcServerBundle\Exception\MethodNotFoundException
  */
 public function testgetMethodByNameNegative2()
 {
     $manager = new MethodManager();
     $method = $this->getMock('TSCore\\JsonRpcServerBundle\\Method\\IApiMethod');
     $manager->addMethod("asd", $method);
     $manager->getMethodByName("123");
 }
예제 #2
0
 public function dispatch($methodName, $actionName)
 {
     $methodName = strval($methodName);
     $actionName = strval($actionName);
     $methodObject = $this->methodManager->getMethodByName($methodName);
     $action = $this->methodMapper->getClassMethodNameByMethodAndActionName($methodObject, $actionName);
     return function ($rpcRequest) use($methodObject, $action) {
         return $this->invoke($methodObject, $action, $rpcRequest);
     };
 }