function testQueries() { $r = new RestServer(); $t = count(explode("/", $_SERVER["REQUEST_URI"])) - 2; $this->assertEquals($r->getQuery($t), "tests"); $this->assertEquals($r->getRequest()->getURI($t), "tests"); $r->setQuery("/teste/me"); $this->assertEquals($r->getQuery(2), "me"); $this->assertEquals($r->getRequest()->getURI(2), "me"); }
public function foo(RestServer $rest) { if (($name = $rest->getQuery(3)) == null && ($name = $rest->getRequest()->getPost("name")) == null) { $name = "RestServer"; } else { } $rest->getResponse()->setResponse("Hello , " . ucfirst($name) . "."); return $rest; }