Beispiel #1
0
 /**
  * @group before_match
  */
 public function testBeforeMatchRaiseInvalidClass()
 {
     require_once 'tests/module/Application/src/Router/BeforeMatchFail.php';
     $excMsg = sprintf('"%s" must be implemented "%s"', BeforeMatchFail::class, BeforeMatchInterface::class);
     $this->setExpectedException(RuntimeException::class, $excMsg);
     Route::reset();
     $router = new Router($this->getDi());
     $router->addRoute('edit-classname', ['route' => '/edit2/([1-9][0-9]*)', 'definitions' => ['controller' => 'posts2', 'action' => 'edit2', 'id' => 1], 'before_match' => ['class_name' => BeforeMatchFail::class]]);
     $router->handle('/edit2/100');
 }