private function getCLI($getopt) { $cli = $this->getMockBuilder('SqlParser\\Utils\\CLI')->setMethods(array('getopt'))->getMock(); $cli->method('getopt')->willReturn($getopt); return $cli; }