mockConnection = $this->getMockBuilder(ReplicationInterface::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'); $this->mockConnection ->expects($this->any()) ->method('getParameters') ->willReturn(new Parameters()); $strategy = new ReplicationConnectionStrategy($this->mockConnection, new MultiExecState()); $this->assertEquals('OK', $strategy->executeCommand($this->mockCommand)); } }