getMockBuilder('\Box\Mod\Theme\Service')->getMock(); $themeService->expects($this->atLeastOnce()) ->method('getCurrentClientAreaThemeCode'); $di = new \Pimple\Container(); $di['mod_service'] = $di->protect(function() use ($themeService) {return $themeService;}); $service->setDi($di); $result = $service->getPairs(); $this->assertIsArray($result); } }