eZ\Publish\Core\Limitation\Tests\SubtreeLimitationTypeTest::testValidateErrorWrongPath PHP Method

testValidateErrorWrongPath() public method

    public function testValidateErrorWrongPath()
    {
        $limitation = new SubtreeLimitation(array('limitationValues' => array('/1/2/42/')));
        $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->returnValue(new SPILocation(array('pathString' => '/1/5/42'))));
        }
        // Need to create inline instead of depending on testConstruct() to get correct mock instance
        $limitationType = $this->testConstruct();
        $validationErrors = $limitationType->validate($limitation);
        self::assertCount(1, $validationErrors);
    }