/** * Run test toOptionArray method * * @return void */ public function testToOptionArray() { $pageCollectionMock = $this->getMock('Magento\\Cms\\Model\\Resource\\Page\\Collection', [], [], '', false); $pageCriteriaMock = $this->getMock('Magento\\Cms\\Model\\Resource\\PageCriteria', [], [], '', false); $this->pageRepositoryMock->expects($this->once())->method('getList')->with($pageCriteriaMock)->will($this->returnValue($pageCollectionMock)); $this->pageCriteriaFactoryMock->expects($this->once())->method('create')->will($this->returnValue($pageCriteriaMock)); $pageCollectionMock->expects($this->once())->method('toOptionIdArray')->will($this->returnValue('return-value')); $this->assertEquals('return-value', $this->page->toOptionArray()); }
/** * Run test getResultCollection method * * @return void */ public function testGetResultCollection() { $this->repositoryMock->expects($this->once())->method('getList')->with($this->pageCollection)->will($this->returnValue('return-value')); $this->assertEquals('return-value', $this->pageCollection->getResultCollection()); }