mockConnection = $this->getMockBuilder(NodeConnectionInterface::class)->getMock(); $this->mockCommand = $this->getMockBuilder(CommandInterface::class)->getMock(); } /** * @return void */ public function testExecuteCommand(): void { $this->mockConnection ->expects($this->once()) ->method('executeCommand') ->with($this->mockCommand) ->willReturn('OK'); $strategy = new NodeConnectionStrategy($this->mockConnection, new MultiExecState()); $this->assertEquals('OK', $strategy->executeCommand($this->mockCommand)); } }