Пример #1
0
 public function testPathIsProperlyTrimmed()
 {
     $parser = new \Foothing\Wrappr\Installer\Parser();
     $this->assertEquals($parser->trimPath(""), "");
     $this->assertEquals($parser->trimPath("test"), "test");
     $this->assertEquals($parser->trimPath("/test"), "test");
     $this->assertEquals($parser->trimPath("//test"), "test");
     $this->assertEquals($parser->trimPath("test/"), "test");
     $this->assertEquals($parser->trimPath("test/foo/"), "test/foo");
     $this->setExpectedException('Exception');
     $this->assertEquals($parser->trimPath("test//"), "test");
 }
Пример #2
0
 public static function routes()
 {
     $parser = new \Foothing\Wrappr\Installer\Parser();
     return [$parser->parsePattern("api/v1/users/{id}/*"), $parser->parsePattern("api/v1/users/{id}"), $parser->parsePattern("api/v1/*"), $parser->parsePattern("api/v1"), $parser->parsePattern("api/*"), $parser->parsePattern("*")];
 }