Exemple #1
0
 public function testMethodsWithMap()
 {
     $this->assertEquals(0, $this->app->count());
     $handler = function () {
         return "!!!";
     };
     $this->app->get('/', $handler);
     $this->assertEquals(1, $this->app->count());
     $this->app->post('/', $handler);
     $this->assertEquals(2, $this->app->count());
     $this->app->put('/', $handler);
     $this->assertEquals(3, $this->app->count());
     $this->app->delete('/', $handler);
     $this->assertEquals(4, $this->app->count());
     $this->app->options('/', $handler);
     $this->assertEquals(5, $this->app->count());
 }
 }, ["admin", "middleware"]);
 $app->put('/abc/def', ["admin", "middleware"], ['admin', 'action']);
 $app->put('/abc/ghi', ["admin", "middleware"], ['admin', 'action'], function () {
 });
 $app->put('/def/{id}/2', function () {
 }, function () {
 });
 $app->put('/def/{id}/{name}', ["admin", "middleware"], function () {
 });
 $app->put('/defg/{id}/{what}', function () {
 }, ["admin", "middleware"]);
 $app->put('/def/def/{shit}', ["admin", "action"], ['admin', 'middleware']);
 $app->put('/def/3/{zzz}', ["admin", "middleware"], ['admin', 'action'], function () {
 });
 $app->options('/abc', function () {
 }, function () {
 });
 $app->options('/abc/{id}/{name}', ["admin", "middleware"], function () {
 });
 $app->options('/abd/{id}/{what}', function () {
 }, ["admin", "middleware"]);
 $app->options('/abc/def', ["admin", "middleware"], ['admin', 'action']);
 $app->options('/abc/ghi', ["admin", "middleware"], ['admin', 'action'], function () {
 });
 $app->options('/def/{id}/2', function () {
 }, function () {
 });
 $app->options('/def/{id}/{name}', ["admin", "middleware"], function () {
 });
 $app->options('/defg/{id}/{what}', function () {
 }, ["admin", "middleware"]);