Skip to content

Commit

Permalink
Merge pull request #16 from castiron/feature/trigger-assignment-rule
Browse files Browse the repository at this point in the history
Add support for triggering an Assignment Rule
  • Loading branch information
cristianpontes authored Aug 13, 2017
2 parents 3f947e3 + 028a7e7 commit cfed3dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Request/InsertRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ public function triggerWorkflow()
return $this;
}

/**
* @param int $ruleId
* @return InsertRecords
*/
public function triggerAssignmentRule($ruleId)
{
$this->request->setParam('larid', $ruleId);
return $this;
}

/**
* @return InsertRecords
*/
Expand Down
8 changes: 7 additions & 1 deletion Tests/Request/InsertRecordsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public function testTriggerWorkflow()
$this->assertEquals('true', $this->request->getParam('wfTrigger'));
}

public function testTriggerAssignmentRule()
{
$ruleId = 99001321231213;
$this->insertRecords->triggerAssignmentRule($ruleId);
$this->assertEquals($ruleId, $this->request->getParam('larid'));
}

public function testOnDuplicate()
{
$this->insertRecords->onDuplicateUpdate();
Expand All @@ -64,4 +71,3 @@ protected function setUp()
$this->insertRecords = new Request\InsertRecords($this->request);
}
}

0 comments on commit cfed3dd

Please sign in to comment.