configMock = $this->createMock(Config::class); $this->paymentDOMock = $this->createMock(PaymentDataObjectInterface::class); $this->paymentMock = $this->createMock(Payment::class); /** @var MockObject|SubjectReader subjectReaderMock */ $this->subjectReaderMock = $this->createMock(SubjectReader::class); $this->builder = new SolutionDataBuilder($this->subjectReaderMock, $this->configMock); } public function testBuild() { $this->subjectReaderMock->method('readStoreId') ->willReturn('123'); $this->configMock->method('getSolutionId') ->with('123') ->willReturn('solutionid'); $expected = [ 'transactionRequest' => [ 'solution' => [ 'id' => 'solutionid', ] ] ]; $buildSubject = []; $this->assertEquals($expected, $this->builder->build($buildSubject)); } }