NerdsAndCompany\Schematic\Services\UserGroupsTest::setMockSectionsService PHP Method

setMockSectionsService() private method

private setMockSectionsService ( $indexBy ) : PHPUnit_Framework_MockObject_MockObject | Craft\SectionsService
$indexBy
return PHPUnit_Framework_MockObject_MockObject | Craft\SectionsService
    private function setMockSectionsService($indexBy)
    {
        $mockSectionService = $this->getMockBuilder(SectionsService::class)->disableOriginalConstructor()->getMock();
        $mockSectionService->expects($this->any())->method('getAllSections')->with($indexBy)->willReturn($this->getMockSections($indexBy, 2));
        $this->setComponent(Craft::app(), 'sections', $mockSectionService);
        return $mockSectionService;
    }