Code Duplication    Length = 13-14 lines in 3 locations

Test/Unit/Helper/ConsumerscoreTest.php 3 locations

@@ 117-130 (lines=14) @@
114
        $this->assertEquals($expected, $result);
115
    }
116
117
    public function testIsSampleNeeded()
118
    {
119
        $this->databaseHelper->method('getConfigParamWithoutCache')->willReturn(5);
120
        $this->scopeConfig->expects($this->any())
121
            ->method('getValue')
122
            ->willReturnMap(
123
                [
124
                    ['payone_protect/creditrating/sample_mode_frequency', ScopeInterface::SCOPE_STORE, null, 5],
125
                    ['payone_protect/creditrating/sample_mode_enabled', ScopeInterface::SCOPE_STORE, null, 1]
126
                ]
127
            );
128
        $result = $this->consumerscore->isSampleNeeded();
129
        $this->assertTrue($result);
130
    }
131
132
    public function testIsSampleNotNeeded()
133
    {
@@ 132-145 (lines=14) @@
129
        $this->assertTrue($result);
130
    }
131
132
    public function testIsSampleNotNeeded()
133
    {
134
        $this->databaseHelper->method('getConfigParamWithoutCache')->willReturn(3);
135
        $this->scopeConfig->expects($this->any())
136
            ->method('getValue')
137
            ->willReturnMap(
138
                [
139
                    ['payone_protect/creditrating/sample_mode_frequency', ScopeInterface::SCOPE_STORE, null, 5],
140
                    ['payone_protect/creditrating/sample_mode_enabled', ScopeInterface::SCOPE_STORE, null, 1]
141
                ]
142
            );
143
        $result = $this->consumerscore->isSampleNeeded();
144
        $this->assertFalse($result);
145
    }
146
147
    public function testCanShowPaymentHintText()
148
    {
@@ 299-311 (lines=13) @@
296
        $this->assertFalse($result);
297
    }
298
299
    public function testIsCreditratingNeededWrongEvent()
300
    {
301
        $this->scopeConfig->expects($this->any())
302
            ->method('getValue')
303
            ->willReturnMap(
304
                [
305
                    ['payone_protect/creditrating/enabled', ScopeInterface::SCOPE_STORE, null, 1],
306
                    ['payone_protect/creditrating/integration_event', ScopeInterface::SCOPE_STORE, null, 'before_payment']
307
                ]
308
            );
309
        $result = $this->consumerscore->isCreditratingNeeded('after_payment', 500);
310
        $this->assertFalse($result);
311
    }
312
313
    public function testIsCreditratingNeededWrongPrice()
314
    {