protected function getMockHandler($name, $method) { $name = 'Bolt\\Twig\\Handler\\' . $name; $handler = $this->getMockBuilder($name)->setMethods([$method])->setConstructorArgs([$this->getApp()])->getMock(); $handler->expects($this->once())->method($method)->willReturn(true); return $handler; }