public function testValidatePass(SectionLimitation $limitation)
{
if (!empty($limitation->limitationValues)) {
$this->getPersistenceMock()->expects($this->any())->method('sectionHandler')->will($this->returnValue($this->sectionHandlerMock));
foreach ($limitation->limitationValues as $key => $value) {
$this->sectionHandlerMock->expects($this->at($key))->method('load')->with($value)->will($this->returnValue(new SPISection(array('id' => $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);
}