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"); }
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("*")]; }