public function initFromArrayDataProvider() { $dataFull = json_decode($this->loadFixture(static::FILE_FIXTURE_1), true); $dataAttr = json_decode($this->loadFixture(static::FILE_FIXTURE_2), true); $expectation = new DecisionTaskStartedEventAttributes(); $expectation->setScheduledEventId(2); $expectation->setIsEmpty(false); return array(array('success-full' => array(static::INDEX_INPUT => $dataFull, static::INDEX_EXPECTATION => $expectation), 'success-attr' => array(static::INDEX_INPUT => $dataAttr, static::INDEX_EXPECTATION => $expectation))); }
/** * @return array */ public function convertToArray() { if ($this->isEmpty) { return null; } $result = array(static::INDEX_EVENT_ID => $this->eventId, static::INDEX_EVENT_TYPE => $this->eventType, static::INDEX_EVENT_TIMESTAMP => $this->eventTimestamp); $result = array_merge($result, $this->activityTaskScheduledEventAttributes->convertToArray(), $this->activityTaskStartedEventAttributes->convertToArray(), $this->activityTaskCompletedEventAttributes->convertToArray()); $result = array_merge($result, $this->decisionTaskScheduledEventAttributes->convertToArray(), $this->decisionTaskStartedEventAttributes->convertToArray(), $this->decisionTaskCompletedEventAttributes->convertToArray()); return $result; }
public function initFromArrayDataProvider() { $inputDecisionScheduled = json_decode($this->loadFixture(static::FILE_FIXTURE_DECISION_SCHEDULED), true); $inputDecisionStarted = json_decode($this->loadFixture(static::FILE_FIXTURE_DECISION_STARTED), true); $inputDecisionCompleted = json_decode($this->loadFixture(static::FILE_FIXTURE_DECISION_COMPLETED), true); $expectation = new Event(); $attributesDecisionScheduled = new DecisionTaskScheduledEventAttributes(); $attributesDecisionScheduled->initFromArray($inputDecisionScheduled); $attributesDecisionStarted = new DecisionTaskStartedEventAttributes(); $attributesDecisionStarted->initFromArray($inputDecisionStarted); $expectation->setActivityTaskScheduledEventAttributes(new ActivityTaskScheduledEventAttributes()); $expectation->setActivityTaskStartedEventAttributes(new ActivityTaskStartedEventAttributes()); $expectation->setActivityTaskCompletedEventAttributes(new ActivityTaskCompletedEventAttributes()); $expectation->setDecisionTaskCompletedEventAttributes(new DecisionTaskCompletedEventAttributes()); $expectation->setDecisionTaskStartedEventAttributes($attributesDecisionStarted); $expectation->setDecisionTaskScheduledEventAttributes($attributesDecisionScheduled); $expectation->setEventId(2); $expectation->setEventTimestamp('2015-10-27T10:57:11+00:00'); $expectation->setEventType('DecisionTaskScheduled'); $expectation->setIsEmpty(false); return array(array('decision-task-scheduled-mock' => array(static::INDEX_INPUT => $inputDecisionScheduled, static::INDEX_EXPECTATION => $expectation), 'decision-task-started-mock' => array(static::INDEX_INPUT => $inputDecisionStarted, static::INDEX_EXPECTATION => $expectation))); }