composer update
This commit is contained in:
parent
9ac51e0523
commit
623395064f
279 changed files with 4458 additions and 16328 deletions
35
vendor/nikic/fast-route/test/RouteCollectorTest.php
vendored
Normal file
35
vendor/nikic/fast-route/test/RouteCollectorTest.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace FastRoute;
|
||||
|
||||
class RouteCollectorTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testShortcuts() {
|
||||
$r = new DummyRouteCollector();
|
||||
|
||||
$r->delete('/delete', 'delete');
|
||||
$r->get('/get', 'get');
|
||||
$r->head('/head', 'head');
|
||||
$r->patch('/patch', 'patch');
|
||||
$r->post('/post', 'post');
|
||||
$r->put('/put', 'put');
|
||||
|
||||
$expected = [
|
||||
['DELETE', '/delete', 'delete'],
|
||||
['GET', '/get', 'get'],
|
||||
['HEAD', '/head', 'head'],
|
||||
['PATCH', '/patch', 'patch'],
|
||||
['POST', '/post', 'post'],
|
||||
['PUT', '/put', 'put'],
|
||||
];
|
||||
|
||||
$this->assertSame($expected, $r->routes);
|
||||
}
|
||||
}
|
||||
|
||||
class DummyRouteCollector extends RouteCollector {
|
||||
public $routes = [];
|
||||
public function __construct() {}
|
||||
public function addRoute($method, $route, $handler) {
|
||||
$this->routes[] = [$method, $route, $handler];
|
||||
}
|
||||
}
|
Reference in a new issue