/** * 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 testEqualsReturnsFalseForDifferentUid() { static::assertFalse($this->uid->equals(new Uid('im-not-matching'))); }