arguments = ['arg1', 'arg2']; $this->expectedValue = ['value']; $this->mockCommand = $this->getMockBuilder(CommandInterface::class)->getMock(); $this->mockClient = $this->getMockBuilder(ClientInterface::class)->getMock(); $this->testClass = new class($this->mockClient) extends AbstractContainer { public function getContainerCommandId(): string { return 'test'; } }; } /** * @return void */ public function testGetContainerId(): void { $this->assertSame('test', $this->testClass->getContainerCommandId()); } /** * @return void */ public function testCallReturnsValidCommandResponse(): void { $modifiedArguments = ['TEST', ['arg1', 'arg2']]; $this->mockClient ->expects($this->once()) ->method('createCommand') ->with($this->equalTo('test'), $modifiedArguments) ->willReturn($this->mockCommand); $this->mockClient ->expects($this->once()) ->method('executeCommand') ->with($this->mockCommand) ->willReturn($this->expectedValue); $this->assertSame($this->expectedValue, $this->testClass->test($this->arguments)); } }