Example #1
0
 public function testCreateWithArgs()
 {
     $handler = new Nether\Avenue\RouteHandler(static::$RequestData['Test']);
     // set the argv after in a manner similar to how the main router will
     // do it.
     $handler->SetArgv(['Patrick Stewart']);
     (new Verify('make sure $Class was set right.', $handler->GetClass()))->equals('Nether\\Avenue\\LocalRouteTestLol');
     (new Verify('make sure $Method was set right.', $handler->GetMethod()))->equals('Test');
     (new Verify('make sure $Argv was set right.', $handler->GetArgv()[0]))->equals('Patrick Stewart');
     return;
 }
Example #2
0
 public function WillHandlerAcceptRequest(Nether\Avenue\RouteHandler $h)
 {
     /*//
     	return(bool)
     	//*/
     $class = $h->GetClass();
     // if the handler class does not have the query method then assume
     // that it will handle it.
     if (!method_exists($class, 'WillHandleRequest')) {
         return true;
     }
     return call_user_func_array([$class, 'WillHandleRequest'], [$this, $h]);
 }