createPartialMock(Config::class, ['getVertexHost']); } private function createValidationConfigMock() { return $this->createPartialMock( Config::class, ['getVertexHost', 'getVertexAddressHost'] ); } public function testHappyTaxCalculation() { $calculationReturn = ['moo']; $configMock = $this->createCalculationConfigMock(); $soapClientMock = $this->createPartialMock(\SoapClient::class, [static::CALCULATION_FUNCTION]); $soapClientMock->expects($this->once()) ->method(static::CALCULATION_FUNCTION) ->willReturn($calculationReturn); $vertex = $this->getObject( ApiClient::class, ['config' => $configMock] ); $result = $this->invokeInaccessibleMethod($vertex, 'performSoapCall', $soapClientMock, 'quote', ''); $this->assertEquals($calculationReturn, $result); } public function testHappyTaxAreaLookup() { $lookupReturn = ['cow']; $configMock = $this->createValidationConfigMock(); $soapClientMock = $this->createPartialMock(\SoapClient::class, [static::LOOKUP_FUNCTION]); $soapClientMock->expects($this->once()) ->method(static::LOOKUP_FUNCTION) ->willReturn($lookupReturn); $vertex = $this->getObject( ApiClient::class, ['config' => $configMock] ); $result = $this->invokeInaccessibleMethod($vertex, 'performSoapCall', $soapClientMock, 'tax_area_lookup', ''); $this->assertEquals($lookupReturn, $result); } }