eZ\Publish\Core\Limitation\Tests\SubtreeLimitationTypeTest::testValidateError PHP Метод

testValidateError() публичный Метод

public testValidateError ( eZ\Publish\API\Repository\Values\User\Limitation\SubtreeLimitation $limitation, integer $errorCount )
$limitation eZ\Publish\API\Repository\Values\User\Limitation\SubtreeLimitation
$errorCount integer
    public function testValidateError(SubtreeLimitation $limitation, $errorCount)
    {
        if (!empty($limitation->limitationValues)) {
            $this->getPersistenceMock()->expects($this->any())->method('locationHandler')->will($this->returnValue($this->locationHandlerMock));
            foreach ($limitation->limitationValues as $key => $value) {
                $pathArray = explode('/', trim($value, '/'));
                $this->locationHandlerMock->expects($this->at($key))->method('load')->with(end($pathArray))->will($this->throwException(new NotFoundException('location', $value)));
            }
        } else {
            $this->getPersistenceMock()->expects($this->never())->method($this->anything());
        }
        // Need to create inline instead of depending on testConstruct() to get correct mock instance
        $limitationType = $this->testConstruct();
        $validationErrors = $limitationType->validate($limitation);
        self::assertCount($errorCount, $validationErrors);
    }