protected function setUp() { $this->queryResultId = new QueryResultId(Uuid::uuid4()); $this->metaInformation = new MetaInformation(new WorkflowRunId(Uuid::uuid4()), new ActionId(Uuid::uuid4()), new Name('TestQuery'), new Arguments(array('foo' => 'bar')), 1); $this->result = new Item('A result item'); $this->queryResultCreated = new QueryResultCreated(array('queryResultId' => $this->queryResultId->toString(), 'metaInformation' => $this->metaInformation->toArray(), 'result' => array('resultClass' => get_class($this->result), 'data' => $this->result->toJSON()))); }
public function testToAndFromArray() { $aMetaInformationArray = $this->metaInformation->toArray(); $newMetaInformation = MetaInformation::fromArray($aMetaInformationArray); $this->assertTrue($this->metaInformation->sameValueAs($newMetaInformation)); }
/** * @param QueryResultId $aQueryResultId * @param MetaInformation $aMetaInformation * @param Result $aResult */ public function __construct(QueryResultId $aQueryResultId, MetaInformation $aMetaInformation, Result $aResult) { $this->update(new QueryResultCreated(array('queryResultId' => $aQueryResultId->toString(), 'metaInformation' => $aMetaInformation->toArray(), 'result' => array('resultClass' => get_class($aResult), 'data' => $aResult->toJSON())))); }