|
@@ 126-135 (lines=10) @@
|
| 123 |
|
* @param \eZ\Publish\API\Repository\Values\ValueObject $actualObject |
| 124 |
|
* @param array $skipProperties |
| 125 |
|
*/ |
| 126 |
|
protected function assertPropertiesCorrect(array $expectedValues, ValueObject $actualObject, array $skipProperties = array()) |
| 127 |
|
{ |
| 128 |
|
foreach ($expectedValues as $propertyName => $propertyValue) { |
| 129 |
|
if (in_array($propertyName, $skipProperties)) { |
| 130 |
|
continue; |
| 131 |
|
} |
| 132 |
|
|
| 133 |
|
$this->assertProperty($propertyName, $propertyValue, $actualObject->$propertyName); |
| 134 |
|
} |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
protected function assertSameClassPropertiesCorrect( |
| 138 |
|
array $propertiesNames, |
|
@@ 137-151 (lines=15) @@
|
| 134 |
|
} |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
protected function assertSameClassPropertiesCorrect( |
| 138 |
|
array $propertiesNames, |
| 139 |
|
ValueObject $expectedValues, |
| 140 |
|
ValueObject $actualObject, |
| 141 |
|
array $skipProperties = array(), |
| 142 |
|
$equal = true |
| 143 |
|
) { |
| 144 |
|
foreach ($propertiesNames as $propertyName) { |
| 145 |
|
if (in_array($propertyName, $skipProperties)) { |
| 146 |
|
continue; |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
$this->assertProperty($propertyName, $expectedValues->$propertyName, $actualObject->$propertyName, $equal); |
| 150 |
|
} |
| 151 |
|
} |
| 152 |
|
|
| 153 |
|
/** |
| 154 |
|
* Asserts all properties from $expectedValues are correctly set in |
|
@@ 161-170 (lines=10) @@
|
| 158 |
|
* @param \eZ\Publish\API\Repository\Values\ValueObject $actualObject |
| 159 |
|
* @param array $skipProperties |
| 160 |
|
*/ |
| 161 |
|
protected function assertStructPropertiesCorrect(ValueObject $expectedValues, ValueObject $actualObject, array $skipProperties = array()) |
| 162 |
|
{ |
| 163 |
|
foreach ($expectedValues as $propertyName => $propertyValue) { |
| 164 |
|
if (in_array($propertyName, $skipProperties)) { |
| 165 |
|
continue; |
| 166 |
|
} |
| 167 |
|
|
| 168 |
|
$this->assertProperty($propertyName, $propertyValue, $actualObject->$propertyName); |
| 169 |
|
} |
| 170 |
|
} |
| 171 |
|
|
| 172 |
|
private function assertProperty($propertyName, $expectedValue, $actualValue, $equal = true) |
| 173 |
|
{ |