Ejemplo n.º 1
0
 public function testAnyMethod()
 {
     $anyMock = Mockery::mock(ServerRequestInterface::class);
     $anyMock->shouldReceive('getMethod')->andReturn('GET');
     $anyMock->shouldReceive('getUri->getPath')->andReturn('/');
     $anyMock->shouldReceive('setArguments')->with([]);
     $this->app->any('/', function () {
         return 'any';
     });
     $this->assertEquals('any', $this->app->dispatch($anyMock));
     $this->assertEquals('any', $this->app->dispatch($anyMock));
 }
Ejemplo n.º 2
0
 }, ["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"]);
 $app->options('/def/def/{shit}', ["admin", "action"], ['admin', 'middleware']);
 $app->options('/def/3/{zzz}', ["admin", "middleware"], ['admin', 'action'], function () {
 });
 $app->any('/abc', function () {
 }, function () {
 });
 $app->any('/abc/{id}/{name}', ["admin", "middleware"], function () {
 });
 $app->any('/abd/{id}/{what}', function () {
 }, ["admin", "middleware"]);
 $app->any('/abc/def', ["admin", "middleware"], ['admin', 'action']);
 $app->any('/abc/ghi', ["admin", "middleware"], ['admin', 'action'], function () {
 });
 $app->any('/def/{id}/2', function () {
 }, function () {
 });
 $app->any('/def/{id}/{name}', ["admin", "middleware"], function () {
 });
 $app->any('/defg/{id}/{what}', function () {
 }, ["admin", "middleware"]);