Esempio n. 1
0
 public function testGeoPointLocation()
 {
     $point = new GeoPoint(25.269876, 110.333061);
     $location = new Object("Location");
     $location->set("location", $point);
     $location->save();
     $location->destroy();
 }
Esempio n. 2
0
 public function testDoCloudQueryWithPvalues()
 {
     $obj = new Object("TestObject");
     $obj->set("name", "alice");
     $obj->save();
     $resp = Query::doCloudQuery("SELECT * FROM TestObject " . "WHERE name = ? LIMIT ?", array("alice", 1));
     $this->assertGreaterThan(0, count($resp["results"]));
     $obj->destroy();
 }
Esempio n. 3
0
 public function testSaveObjectWithFile()
 {
     $obj = new Object("TestObject");
     $obj->set("name", "alice");
     $file = File::createWithData("test.txt", "你好,中国!");
     $obj->addIn("files", $file);
     $obj->save();
     $this->assertNotEmpty($obj->getObjectId());
     $this->assertNotEmpty($file->getObjectId());
     $this->assertNotEmpty($file->getUrl());
     $file->destroy();
     $obj->destroy();
 }