Code Duplication    Length = 9-12 lines in 5 locations

Test/Unit/Helper/ToolkitTest.php 1 location

@@ 212-223 (lines=12) @@
209
        $this->assertTrue($result);
210
    }
211
212
    public function testGetAdditionalDataEntryOld()
213
    {
214
        $expected = 'value';
215
216
        $dataObject = $this->getMockBuilder(DataObject::class)->disableOriginalConstructor()->getMock();
217
        $dataObject->method('getData')->willReturn($expected);
218
219
        $this->shopHelper->method('getMagentoVersion')->willReturn('2.0.0');
220
221
        $result = $this->toolkit->getAdditionalDataEntry($dataObject, 'key');
222
        $this->assertEquals($expected, $result);
223
    }
224
225
    public function testGetAdditionalDataEntryNew()
226
    {

Test/Unit/Observer/CheckoutSubmitBeforeTest.php 1 location

@@ 198-209 (lines=12) @@
195
        $this->assertTrue($result);
196
    }
197
198
    public function testGetScoreByCreditrating()
199
    {
200
        $expected = 'G';
201
202
        $this->consumerscore->method('sendRequest')->willReturn(true);
203
204
        $address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->setMethods(['getPayoneProtectScore'])->getMock();
205
        $address->method('getPayoneProtectScore')->willReturn($expected);
206
207
        $result = $this->classToTest->getScoreByCreditrating($address);
208
        $this->assertEquals($expected, $result);
209
    }
210
211
    public function testGetScoreByCreditratingScoreIsset()
212
    {

Test/Unit/Block/Onepage/ReviewTest.php 1 location

@@ 190-198 (lines=9) @@
187
        $this->assertEquals('', $result);
188
    }
189
190
    public function testRenderShippingRateValueNoError()
191
    {
192
        $expected = 'code';
193
        $object = $this->getMockBuilder(DataObject::class)->disableOriginalConstructor()->setMethods(['getErrorMessage', 'getCode'])->getMock();
194
        $object->method('getErrorMessage')->willReturn(false);
195
        $object->method('getCode')->willReturn($expected);
196
        $result = $this->classToTest->renderShippingRateValue($object);
197
        $this->assertEquals($expected, $result);
198
    }
199
200
    public function testRenderShippingRateOption()
201
    {

Test/Unit/Model/Risk/AddresscheckTest.php 1 location

@@ 283-293 (lines=11) @@
280
        $this->assertEquals($expected, $result);
281
    }
282
283
    public function testGetScoreStillValid()
284
    {
285
        $this->addresscheck->method('sendRequest')->willReturn(true);
286
        $address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->getMock();
287
288
        $expected = 'X';
289
        $this->databaseHelper->method('getOldAddressStatus')->willReturn($expected);
290
291
        $result = $this->classToTest->getScore($address);
292
        $this->assertEquals($expected, $result);
293
    }
294
295
    public function testGetResponse()
296
    {

Test/Unit/Observer/Transactionstatus/AppointedTest.php 1 location

@@ 64-73 (lines=10) @@
61
        ]);
62
    }
63
64
    public function testExecute()
65
    {
66
        $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock();
67
68
        $observer = $this->getMockBuilder(Observer::class)->disableOriginalConstructor()->setMethods(['getOrder'])->getMock();
69
        $observer->method('getOrder')->willReturn($order);
70
71
        $result = $this->classToTest->execute($observer);
72
        $this->assertNull($result);
73
    }
74
75
    public function testExecuteException()
76
    {