public function getMockCategoriesService() { $mock = $this->getMockBuilder(CategoriesService::class)->disableOriginalConstructor()->getMock(); $mock->expects($this->exactly(1))->method('getAllGroups')->willReturn([]); return $mock; }