eZ\Publish\Core\Limitation\Tests\NewObjectStateLimitationTypeTest::testEvaluate PHP Method

testEvaluate() public method

public testEvaluate ( eZ\Publish\API\Repository\Values\User\Limitation\NewObjectStateLimitation $limitation, eZ\Publish\API\Repository\Values\ValueObject $object, array $targets, $expected )
$limitation eZ\Publish\API\Repository\Values\User\Limitation\NewObjectStateLimitation
$object eZ\Publish\API\Repository\Values\ValueObject
$targets array
    public function testEvaluate(NewObjectStateLimitation $limitation, ValueObject $object, array $targets, $expected)
    {
        // Need to create inline instead of depending on testConstruct() to get correct mock instance
        $limitationType = $this->testConstruct();
        $userMock = $this->getUserMock();
        $userMock->expects($this->never())->method($this->anything());
        $persistenceMock = $this->getPersistenceMock();
        $persistenceMock->expects($this->never())->method($this->anything());
        $value = $limitationType->evaluate($limitation, $userMock, $object, $targets);
        self::assertInternalType('boolean', $value);
        self::assertEquals($expected, $value);
    }