Exemple #1
0
 public function post($rule, $function, $default = null)
 {
     $default = is_null($default) ? function ($route, $input) {
         echo "404 Not Found\n";
     } : $default;
     return Yamaki\Router::generate()->input(\Yamaki\Input::generate())->defaultRoute(\Yamaki\Route::generate()->callback($default))->put(\Yamaki\Route::generate()->rule($rule)->viaPost()->callback($function))->dispatch();
 }
Exemple #2
0
 function it_should_have_route_and_dispatch()
 {
     $_SERVER['REQUEST_URI'] = "/hoge/12345678.12345678/?url=http%3a%2f%2ftest.jp/path";
     $this->obj->input(\Yamaki\Input::generate());
     $willMatcheRoute = \Yamaki\Route::generate()->rule("/hoge/:fuga/")->callback(function () {
     });
     $this->obj->put($willMatcheRoute);
     $this->assertEquals(get_class($this->obj->dispatch()), 'Yamaki\\Route');
     $this->assertEquals($this->obj->dispatch(), $willMatcheRoute);
 }
Exemple #3
0
 function setUp()
 {
     $this->obj = \Yamaki\Input::generate();
 }