NerdsAndCompany\Schematic\Services\CategoryGroupsTest::getMockCategoryGroup PHP Метод

getMockCategoryGroup() приватный Метод

private getMockCategoryGroup ( string $groupId ) : PHPUnit_Framework_MockObject_MockObject | Craft\CategoryGroupModel
$groupId string
Результат PHPUnit_Framework_MockObject_MockObject | Craft\CategoryGroupModel
    private function getMockCategoryGroup($groupId)
    {
        $mockCategoryGroup = $this->getMockBuilder(CategoryGroupModel::class)->disableOriginalConstructor()->getMock();
        $mockCategoryGroup->expects($this->any())->method('__get')->willReturnMap([['id', $groupId], ['fieldLayoutId', $groupId], ['handle', 'groupHandle' . $groupId], ['name', 'groupName' . $groupId]]);
        $mockCategoryGroup->expects($this->any())->method('getLocales')->willReturn([$this->getMockCategoryGroupLocale()]);
        $mockCategoryGroup->expects($this->any())->method('getAllErrors')->willReturn(['ohnoes' => 'horrible error']);
        return $mockCategoryGroup;
    }