public function testMatchScheme() { // no limitations $route = new Host("/"); $this->assertTrue($route->matchScheme("http")); $this->assertTrue($route->matchScheme("https")); $this->assertTrue($route->matchScheme("http://")); $this->assertTrue($route->matchScheme("https://")); $this->assertTrue($route->matchScheme("HTTP")); $this->assertTrue($route->matchScheme("HTTPS")); // not http/https, but should not happen $this->assertTrue($route->matchScheme("ftp")); // only http $route->setScheme("http"); $this->assertTrue($route->matchScheme("http")); $this->assertFalse($route->matchScheme("https")); $this->assertTrue($route->matchScheme("HTTP")); $this->assertFalse($route->matchScheme("HTTPS")); // only https $route->setScheme("https"); $this->assertTrue($route->matchScheme("https")); $this->assertFalse($route->matchScheme("http")); $this->assertTrue($route->matchScheme("HTTPS")); $this->assertFalse($route->matchScheme("HTTP")); }