예제 #1
0
 public function testIncludeNestObjects()
 {
     // it accepts nested objects
     $query = new Query("TestObject");
     $query->_include("creator");
     $query->_include("object.creator");
     $out = $query->encode();
     $this->assertEquals("creator,object.creator", $out["include"]);
     // it accepts variable number of keys
     $query = new Query("TestObject");
     $query->_include("creator");
     $query->_include("object.creator", "foo");
     $out = $query->encode();
     $this->assertEquals("creator,object.creator,foo", $out["include"]);
     // it accepts array of fields
     $query = new Query("TestObject");
     $query->_include("creator");
     $query->_include(array("object.creator", "foo"));
     $out = $query->encode();
     $this->assertEquals("creator,object.creator,foo", $out["include"]);
 }