| @@ 157-164 (lines=8) @@ | ||
| 154 | $this->assertFalse($result); |
|
| 155 | } |
|
| 156 | ||
| 157 | public function testRenderAddress() |
|
| 158 | { |
|
| 159 | $address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->getMock(); |
|
| 160 | $address->method('getData')->willReturn(['key' => 'value']); |
|
| 161 | $result = $this->classToTest->renderAddress($address); |
|
| 162 | $expected = 'address'; // see setUp method |
|
| 163 | $this->assertEquals($expected, $result); |
|
| 164 | } |
|
| 165 | ||
| 166 | public function testGetCarrierName() |
|
| 167 | { |
|
| @@ 182-188 (lines=7) @@ | ||
| 179 | $this->assertEquals($expected, $result); |
|
| 180 | } |
|
| 181 | ||
| 182 | public function testRenderShippingRateValue() |
|
| 183 | { |
|
| 184 | $object = $this->getMockBuilder(DataObject::class)->disableOriginalConstructor()->setMethods(['getErrorMessage'])->getMock(); |
|
| 185 | $object->method('getErrorMessage')->willReturn('error'); |
|
| 186 | $result = $this->classToTest->renderShippingRateValue($object); |
|
| 187 | $this->assertEquals('', $result); |
|
| 188 | } |
|
| 189 | ||
| 190 | public function testRenderShippingRateValueNoError() |
|
| 191 | { |
|
| @@ 241-249 (lines=9) @@ | ||
| 238 | $this->classToTest->handleAddressManagement($address, $quote, false); |
|
| 239 | } |
|
| 240 | ||
| 241 | public function testGetScoreR() |
|
| 242 | { |
|
| 243 | $this->addresscheck->method('sendRequest')->willReturn(['status' => 'INVALID']); |
|
| 244 | $address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->getMock(); |
|
| 245 | ||
| 246 | $result = $this->classToTest->getScore($address); |
|
| 247 | $expected = 'R'; |
|
| 248 | $this->assertEquals($expected, $result); |
|
| 249 | } |
|
| 250 | ||
| 251 | public function testGetScorePersonstatusNoMapping() |
|
| 252 | { |
|