示例#1
0
 /**
  * @param array $source
  * @return mixed
  */
 public function initFromArray(array $source)
 {
     $this->activityTaskScheduledEventAttributes = new ActivityTaskScheduledEventAttributes();
     $this->activityTaskScheduledEventAttributes->initFromArray($source);
     $this->activityTaskStartedEventAttributes = new ActivityTaskStartedEventAttributes();
     $this->activityTaskStartedEventAttributes->initFromArray($source);
     $this->activityTaskCompletedEventAttributes = new ActivityTaskCompletedEventAttributes();
     $this->activityTaskCompletedEventAttributes->initFromArray($source);
     $this->decisionTaskScheduledEventAttributes = new DecisionTaskScheduledEventAttributes();
     $this->decisionTaskScheduledEventAttributes->initFromArray($source);
     $this->decisionTaskStartedEventAttributes = new DecisionTaskStartedEventAttributes();
     $this->decisionTaskStartedEventAttributes->initFromArray($source);
     $this->decisionTaskCompletedEventAttributes = new DecisionTaskCompletedEventAttributes();
     $this->decisionTaskCompletedEventAttributes->initFromArray($source);
     $this->eventId = $source[static::INDEX_EVENT_ID];
     $this->eventTimestamp = $source[static::INDEX_EVENT_TIMESTAMP];
     $this->eventType = $source[static::INDEX_EVENT_TYPE];
     $this->isEmpty = false;
 }
示例#2
0
 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)));
 }