Completed
Push — master ( 7c0e42...8c347f )
by André
14:17
created

ValueObjectTestTrait::assertPropertiesCorrect()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 2
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the eZ Publish Kernel package.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\API\Repository\Tests\Values;
10
11
use eZ\Publish\API\Repository\Values\ValueObject;
12
13
trait ValueObjectTestTrait
14
{
15
    /**
16
     * Asserts that properties given in $expectedValues are correctly set in
17
     * $mockedValueObject.
18
     *
19
     * @param mixed[] $expectedValues
20
     * @param \eZ\Publish\API\Repository\Values\ValueObject $actualValueObject
21
     */
22
    public function assertPropertiesCorrect(array $expectedValues, ValueObject $actualValueObject)
23
    {
24
        foreach ($expectedValues as $propertyName => $propertyValue) {
25
            self::assertSame(
26
                $propertyValue,
27
                $actualValueObject->$propertyName,
28
                sprintf('Property %s value is incorrect', $propertyName)
29
            );
30
        }
31
    }
32
}
33