Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xunto committed Jan 20, 2017
1 parent 9c9eb24 commit 86127b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Workflow/WorkflowManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public function findProcess($id)
$data = $this->api->request('process_variables', [
'id' => $id
]);
$data = $data['list']['entries'];

$variables = [];
foreach ($data['list']['entries'] as $entry) {
foreach ($data as $entry) {
$name = $entry['entry']['name'];
@$value = $entry['entry']['value'];

$object[$name] = $value;
$variables[$name] = $value;
}

$process->setVariables($variables);
Expand Down
8 changes: 5 additions & 3 deletions tests/AlfrescoWorkflowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ public function test()
$api = $this->createMock(AlfrescoApiInterface::class);
$api->method('request')
->willReturnOnConsecutiveCalls(
$this->process_info,
$this->process_info,
$this->process_variables
$this->process_info, // On create process
$this->process_info, // On find process after creating
$this->process_variables, // On find process after creating
$this->process_info, // On find process
$this->process_variables // On find process
);

$manager = new WorkflowManager($api);
Expand Down

0 comments on commit 86127b1

Please sign in to comment.