/** * @param JsonSerializationVisitor $visitor * @param WorkflowResult $workflowResult * @param array $type * @param $context * @return array */ public function workflowResultToJson(JsonSerializationVisitor $visitor, WorkflowResult $workflowResult, array $type, Context $context) { $result = $this->convertToPlainArray($workflowResult->getValues()); if (!$result) { return null; } return (object) $result; }
public function testAdd() { $this->result->set('foo', 'foo_value'); $this->result->set('bar', 'bar_value'); $this->assertEquals(array('foo' => 'foo_value', 'bar' => 'bar_value'), $this->result->getValues()); $this->result->add(array('bar' => 'new_bar_value', 'baz' => 'baz_value')); $this->assertEquals(array('foo' => 'foo_value', 'bar' => 'new_bar_value', 'baz' => 'baz_value'), $this->result->getValues()); }