示例#1
0
 public function testOrdering()
 {
     $query = new Query("TestObject");
     $query->addAscend("number");
     $out = $query->encode();
     $this->assertEquals("number", $out["order"]);
     $query->addDescend("updatedAt");
     $out = $query->encode();
     $this->assertEquals("number,-updatedAt", $out["order"]);
     $query->descend("createdAt");
     $out = $query->encode();
     $this->assertEquals("-createdAt", $out["order"]);
     $query->addDescend("updatedAt");
     $out = $query->encode();
     $this->assertEquals("-createdAt,-updatedAt", $out["order"]);
 }