Skip to content

Commit

Permalink
Merge pull request #235 from leancloud/fix-testRelationBatchOp
Browse files Browse the repository at this point in the history
test: fix testRelationBatchOp
  • Loading branch information
weakish authored Jul 19, 2021
2 parents 922f8de + 9c6597b commit 7143b44
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/APITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,29 @@ public function testAddRelation() {

Client::delete("/classes/TestObject/{$resp['objectId']}");
}
/* see #234

public function testRelationBatchOp() {
$adds = array("__op" => "AddRelation",
"objects" => array(
array("__type" => "Pointer",
"className" => "TestObject",
"objectId" => "abc001")));
$removes = array("__op" => "RemoveRelation",
"objects" => array(
"objectId" => "abc001"),
array("__type" => "Pointer",
"className" => "TestObject",
"objectId" => "abc002")));
$addsMore = array("__op" => "AddRelation",
"objects" => array(
array("__type" => "Pointer",
"className" => "TestObject",
"objectId" => "abc003")));
$obj = array("name" => "alice",
"likes" => array("__op" => "Batch",
"ops" => array($adds, $removes)));
"ops" => array($adds, $addsMore)));
$resp = Client::post("/classes/TestObject", $obj);
$this->assertNotEmpty($resp["objectId"]);
Client::delete("/classes/TestObject/{$resp['objectId']}");
}
*/


/**
* Batch on array operation will result error:
Expand Down

0 comments on commit 7143b44

Please sign in to comment.