Beispiel #1
0
 /**
  * Merges this unit with given one
  *
  * @throws \InvalidArgumentException
  *
  * @param UnitOfWork $other
  */
 public function merge(UnitOfWork $other)
 {
     if (!$this->uniqueId->equals($other->uniqueId)) {
         throw new \InvalidArgumentException('Cannot merge units with different UIDs');
     }
     $this->workload = new Workload(sprintf('%s%s', $this->getQuery(), $other->getQuery()));
 }
 public function testMerge()
 {
     $this->unitOfWork->merge($this->buildUnit('-and-some-more-merged'));
     static::assertEquals('my-workload-and-some-more-merged', $this->unitOfWork->getQuery());
 }