Merged in darojas/processmaker (pull request #325)

Se modifica PHPUNIT para newCaseImpersonate y se ajusta id de usuario. Se modifica newCaseImpersonate para que acepte array vacio
This commit is contained in:
erik ao
2014-03-24 12:02:26 -04:00
3 changed files with 6 additions and 4 deletions

View File

@@ -511,6 +511,8 @@ class Cases
$ws = new \wsBase(); $ws = new \wsBase();
if ($variables) { if ($variables) {
$variables = array_shift($variables); $variables = array_shift($variables);
} elseif ($variables == null) {
$variables = array(array());
} }
$fields = $ws->newCaseImpersonate($processUid, $userUid, $variables, $taskUid); $fields = $ws->newCaseImpersonate($processUid, $userUid, $variables, $taskUid);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);

View File

@@ -664,6 +664,7 @@ class Cases extends Api
* @param string $usr_uid {@from body} {@min 32}{@max 32} * @param string $usr_uid {@from body} {@min 32}{@max 32}
* @param string $tas_uid {@from body} {@min 32}{@max 32} * @param string $tas_uid {@from body} {@min 32}{@max 32}
* @param array $variables {@from body} * @param array $variables {@from body}
*
*/ */
public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables=null) public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables=null)
{ {

View File

@@ -228,7 +228,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
*/ */
public function testUpdateReassignCase(array $aResponse) public function testUpdateReassignCase(array $aResponse)
{ {
$response = $this->oCases->updateReassignCase($aResponse['app_uid'], '00000000000000000000000000000001', null, '00000000000000000000000000000001', '23063198853206b666e2bd0085065170'); $response = $this->oCases->updateReassignCase($aResponse['app_uid'], '00000000000000000000000000000001', null, '00000000000000000000000000000001', '73005191052d56727901138030694610');
$this->assertTrue(empty($response)); $this->assertTrue(empty($response));
} }
@@ -263,7 +263,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* Test add Case impersonate to test route case * Test add Case impersonate
* *
* @covers \BusinessModel\Cases::addCaseImpersonate * @covers \BusinessModel\Cases::addCaseImpersonate
* *
@@ -271,9 +271,8 @@ class CasesTest extends \PHPUnit_Framework_TestCase
*/ */
public function testAddCaseImpersonate() public function testAddCaseImpersonate()
{ {
$response = $this->oCases->addCaseImpersonate('1265557095225ff5c688f46031700471', '23063198853206b666e2bd0085065170', '46941969352af5be2ab3f39001216717', array('name' => 'John', 'lastname' => 'Petersson')); $response = $this->oCases->addCaseImpersonate('1265557095225ff5c688f46031700471', '73005191052d56727901138030694610', '46941969352af5be2ab3f39001216717', array(array('name' => 'John', 'lastname' => 'Petersson')));
$this->assertTrue(is_object($response)); $this->assertTrue(is_object($response));
} }
} }