public function testInvoker() { $menu = $this->createMock(CliMenu::class); $menu->expects($this->once())->method('close'); $command = $this->getMockBuilder('stdClass')->setMethods(['__invoke'])->getMock(); $command->expects($this->once())->method('__invoke'); $invoker = new MenuCommandInvoker($command); $invoker->__invoke($menu); }
public function testInvoker() { $menu = $this->getMockBuilder(CliMenu::class)->disableOriginalConstructor()->getMock(); $menu->expects($this->once())->method('close'); $command = $this->getMock('stdClass', ['myCallBack']); $command->expects($this->once())->method('myCallBack'); $invoker = new MenuCommandInvoker([$command, 'myCallBack']); $invoker->__invoke($menu); }