sameValueAs() public method

Tells whether two Country are equal
public sameValueAs ( ValueObjects\ValueObjectInterface $country ) : boolean
$country ValueObjects\ValueObjectInterface
return boolean
示例#1
0
 public function testSameValueAs()
 {
     $country1 = new Country(CountryCode::IT());
     $country2 = new Country(CountryCode::IT());
     $country3 = new Country(CountryCode::US());
     $this->assertTrue($country1->sameValueAs($country2));
     $this->assertFalse($country1->sameValueAs($country3));
     $mock = $this->getMock('ValueObjects\\ValueObjectInterface');
     $this->assertFalse($country1->sameValueAs($mock));
 }