Code Duplication    Length = 10-15 lines in 4 locations

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

@@ 98-112 (lines=15) @@
95
        ]);
96
    }
97
98
    public function testShowMandateLink()
99
    {
100
        $this->paymentHelper->method('isMandateManagementDownloadActive')->willReturn(true);
101
102
        $order = $this->getMockBuilder(Order::class)
103
            ->disableOriginalConstructor()
104
            ->setMethods(['getPayoneMandateId'])
105
            ->getMock();
106
        $order->method('getPayoneMandateId')->willReturn('15');
107
108
        $this->checkoutSession->method('getLastRealOrder')->willReturn($order);
109
110
        $result = $this->classToTest->showMandateLink();
111
        $this->assertTrue($result);
112
    }
113
114
    public function testShowMandateLinkFalse()
115
    {

Test/Unit/Controller/Onepage/DebitTest.php 2 locations

@@ 147-156 (lines=10) @@
144
        $this->assertNull($result);
145
    }
146
147
    public function testExecuteSuccess()
148
    {
149
        $paymentMethod = $this->getMockBuilder(PayoneMethod::class)->disableOriginalConstructor()->getMock();
150
        $this->payment->method('getMethodInstance')->willReturn($paymentMethod);
151
        $this->request->method('getParam')->willReturn(0);
152
        $this->checkoutSession->method('getPayoneMandate')->willReturn(['dummyMandate']);
153
154
        $result = $this->classToTest->execute();
155
        $this->assertNull($result);
156
    }
157
158
    public function testExecuteMandateMismatch()
159
    {
@@ 158-168 (lines=11) @@
155
        $this->assertNull($result);
156
    }
157
158
    public function testExecuteMandateMismatch()
159
    {
160
        $paymentMethod = $this->getMockBuilder(PayoneMethod::class)->disableOriginalConstructor()->getMock();
161
        $paymentMethod->method('getCustomConfigParam')->willReturn(true);
162
        $this->payment->method('getMethodInstance')->willReturn($paymentMethod);
163
        $this->request->method('getParam')->willReturn(1);
164
        $this->checkoutSession->method('getPayoneMandate')->willReturn(['mandate_identification' => 5]);
165
166
        $result = $this->classToTest->execute();
167
        $this->assertNull($result);
168
    }
169
170
    public function testExecuteMandate()
171
    {

Test/Unit/Model/ConfigProviderTest.php 1 location

@@ 101-112 (lines=12) @@
98
        ]);
99
    }
100
101
    public function testGetConfig()
102
    {
103
        $method = $this->getMockBuilder(AbstractMethod::class)
104
            ->disableOriginalConstructor()
105
            ->setMethods(['getInstructions'])
106
            ->getMock();
107
        $method->method('getInstructions')->willReturn('Instruction');
108
        $this->dataHelper->method('getMethodInstance')->willReturn($method);
109
110
        $result = $this->classToTest->getConfig();
111
        $this->assertNotEmpty($result);
112
    }
113
114
    public function testGetConfigNoInstance()
115
    {