/** * Check if aggregate is identified by contract and identifier * * @param Contract $contract * @param Identifier $identifier * * @return bool */ public function isIdentifiedBy(Contract $contract, Identifier $identifier) { return $this->contract->equals($contract) && $this->identifier->equals($identifier); }
public function testIsNotIdentifiedBecauseOfDifferentIdentifier() { $this->identifier->expects($this->any())->method('equals')->willReturn(false); $this->assertFalse($this->aggregate->isIdentifiedBy($this->contract, $this->identifier)); }