protected function init(ChoiceListInterface $choiceList) { $this->choiceLoader->expects($this->any())->method('getSize')->will($this->returnValue(count($choiceList->getChoices()))); $this->choiceLoader->expects($this->any())->method('loadPaginatedChoiceList')->will($this->returnValue($choiceList)); }