public function testSetGeoPoint() { $obj = new LeanObject("TestObject"); $obj->set("location", new GeoPoint(39.9, 116.4)); $obj->save(); $obj2 = new LeanObject("TestObject", $obj->getObjectId()); $obj2->fetch(); $loc = $obj2->get("location"); $this->assertTrue($loc instanceof GeoPoint); $this->assertEquals(39.9, $loc->getLatitude()); $this->assertEquals(116.4, $loc->getLongitude()); }
public function testDestroyObject() { $obj = new LeanObject("TestObject"); $obj->set("tags", array("frontend")); $obj->save(); $this->assertNotEmpty($obj->getObjectId()); $obj->destroy(); $this->setExpectedException("LeanCloud\\LeanException"); $obj->fetch(); }
public function fetch() { $object = new LeanObject("TestObject", '5655637160b2febec4a56259'); $object->fetch(); var_dump($object); }