示例#1
0
 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");
 }
示例#2
0
 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;
 }