Storm\Core\Object\PropertyData::Matches PHP Méthode

Matches() final public méthode

Whether or not the property data is the same.
final public Matches ( PropertyData $Data ) : boolean
$Data PropertyData Another property data
Résultat boolean
    public final function Matches(PropertyData $Data)
    {
        ksort($this->PropertyData);
        ksort($Data->PropertyData);
        return $this->PropertyData === $Data->PropertyData;
    }

Usage Example

 /**
  * @depends testAddedValuesAreSet
  */
 public function testEquivalentPropertyDataMatches()
 {
     $SameValue1 = [1, 2, 3, 4];
     $SameValue2 = "I am another value";
     $OtherPropertyData = $this->MakePropertyDataMock([$this->Property1, $this->Property2]);
     $this->PropertyData[$this->Property1] = $SameValue1;
     $OtherPropertyData[$this->Property1] = $SameValue1;
     $this->PropertyData[$this->Property2] = $SameValue2;
     $OtherPropertyData[$this->Property2] = $SameValue2;
     $this->assertTrue($this->PropertyData->Matches($OtherPropertyData));
     $this->assertTrue($OtherPropertyData->Matches($this->PropertyData));
 }