NerdsAndCompany\Schematic\Services\UserGroupsTest::setMockAssetSourcesService PHP Méthode

setMockAssetSourcesService() private méthode

private setMockAssetSourcesService ( string $indexBy ) : PHPUnit_Framework_MockObject_MockObject | Craft\AssetSourcesService
$indexBy string
Résultat PHPUnit_Framework_MockObject_MockObject | Craft\AssetSourcesService
    private function setMockAssetSourcesService($indexBy)
    {
        $mockAssetSourcesService = $this->getMockBuilder(AssetSourcesService::class)->disableOriginalConstructor()->getMock();
        $mockAssetSourcesService->expects($this->exactly(1))->method('getAllSources')->with($indexBy)->willReturn($this->getMockAssetSources($indexBy, 1));
        $this->setComponent(Craft::app(), 'assetSources', $mockAssetSourcesService);
        return $mockAssetSourcesService;
    }