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