コード例 #1
0
 public function testMethods()
 {
     $route = new Route('/', function () {
         return 'hello';
     });
     $this->assertTrue($route->hasMethod('GET'));
     $this->assertFalse($route->hasMethod('POST'));
     $this->assertFalse($route->hasMethod('PUT'));
     $this->assertFalse($route->hasMethod('DELETE'));
     $route = new Route('/', function () {
         return 'hello';
     }, '*');
     $this->assertTrue($route->hasMethod('GET'));
     $this->assertTrue($route->hasMethod('POST'));
     $this->assertTrue($route->hasMethod('PUT'));
     $this->assertTrue($route->hasMethod('DELETE'));
 }