����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 18.227.0.98 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/ideyshare.name.ng/app/libraries/vendor/nikic/fast-route/test/RouteParser/ |
Upload File : |
<?php namespace FastRoute\RouteParser; use PHPUnit\Framework\TestCase; class StdTest extends TestCase { /** @dataProvider provideTestParse */ public function testParse($routeString, $expectedRouteDatas) { $parser = new Std(); $routeDatas = $parser->parse($routeString); $this->assertSame($expectedRouteDatas, $routeDatas); } /** @dataProvider provideTestParseError */ public function testParseError($routeString, $expectedExceptionMessage) { $parser = new Std(); $this->setExpectedException('FastRoute\\BadRouteException', $expectedExceptionMessage); $parser->parse($routeString); } public function provideTestParse() { return [ [ '/test', [ ['/test'], ] ], [ '/test/{param}', [ ['/test/', ['param', '[^/]+']], ] ], [ '/te{ param }st', [ ['/te', ['param', '[^/]+'], 'st'] ] ], [ '/test/{param1}/test2/{param2}', [ ['/test/', ['param1', '[^/]+'], '/test2/', ['param2', '[^/]+']] ] ], [ '/test/{param:\d+}', [ ['/test/', ['param', '\d+']] ] ], [ '/test/{ param : \d{1,9} }', [ ['/test/', ['param', '\d{1,9}']] ] ], [ '/test[opt]', [ ['/test'], ['/testopt'], ] ], [ '/test[/{param}]', [ ['/test'], ['/test/', ['param', '[^/]+']], ] ], [ '/{param}[opt]', [ ['/', ['param', '[^/]+']], ['/', ['param', '[^/]+'], 'opt'] ] ], [ '/test[/{name}[/{id:[0-9]+}]]', [ ['/test'], ['/test/', ['name', '[^/]+']], ['/test/', ['name', '[^/]+'], '/', ['id', '[0-9]+']], ] ], [ '', [ [''], ] ], [ '[test]', [ [''], ['test'], ] ], [ '/{foo-bar}', [ ['/', ['foo-bar', '[^/]+']] ] ], [ '/{_foo:.*}', [ ['/', ['_foo', '.*']] ] ], ]; } public function provideTestParseError() { return [ [ '/test[opt', "Number of opening '[' and closing ']' does not match" ], [ '/test[opt[opt2]', "Number of opening '[' and closing ']' does not match" ], [ '/testopt]', "Number of opening '[' and closing ']' does not match" ], [ '/test[]', 'Empty optional part' ], [ '/test[[opt]]', 'Empty optional part' ], [ '[[test]]', 'Empty optional part' ], [ '/test[/opt]/required', 'Optional segments can only occur at the end of a route' ], ]; } }