Code Duplication    Length = 15-16 lines in 4 locations

tests/TestCase/Controller/Component/CurrencyConverterComponentTest.php 2 locations

@@ 168-183 (lines=16) @@
165
        $this->assertEquals($expected, $result);
166
    }
167
168
    public function testConvertNotUsingDatabse()
169
    {
170
        $amount = 20.00;
171
        $fromCurrency = 'GBP';
172
        $toCurrency = 'EUR';
173
174
        $this->CurrencyConverter = new CurrencyConverterComponent($this->Registry, [
175
            'database' => false
176
        ]);
177
        $result = $this->CurrencyConverter->convert($amount, $fromCurrency, $toCurrency);
178
179
        $this->assertGreaterThan(20, $result);
180
181
        $result = count($this->Table->find('all')->toArray());
182
        $this->assertEquals(1, $result);
183
    }
184
185
    public function testRateSameCurrency()
186
    {
@@ 231-245 (lines=15) @@
228
        $this->assertEquals($expected, $result);
229
    }
230
231
    public function testRateNotUsingDatabse()
232
    {
233
        $fromCurrency = 'GBP';
234
        $toCurrency = 'EUR';
235
236
        $this->CurrencyConverter = new CurrencyConverterComponent($this->Registry, [
237
            'database' => false
238
        ]);
239
        $result = $this->CurrencyConverter->rate($fromCurrency, $toCurrency);
240
241
        $this->assertGreaterThan(1, $result);
242
243
        $result = count($this->Table->find('all')->toArray());
244
        $this->assertEquals(1, $result);
245
    }
246
247
    public function tearDown()
248
    {

tests/TestCase/View/Helper/CurrencyConverterHelperTest.php 2 locations

@@ 169-184 (lines=16) @@
166
        $this->assertEquals($expected, $result);
167
    }
168
169
    public function testConvertNotUsingDatabse()
170
    {
171
        $amount = 20.00;
172
        $fromCurrency = 'GBP';
173
        $toCurrency = 'EUR';
174
175
        $this->CurrencyConverter = new CurrencyConverterHelper($this->View, [
176
            'database' => false
177
        ]);
178
        $result = $this->CurrencyConverter->convert($amount, $fromCurrency, $toCurrency);
179
180
        $this->assertGreaterThan(20, $result);
181
182
        $result = count($this->Table->find('all')->toArray());
183
        $this->assertEquals(1, $result);
184
    }
185
186
    public function testRateSameCurrency()
187
    {
@@ 232-246 (lines=15) @@
229
        $this->assertEquals($expected, $result);
230
    }
231
232
    public function testRateNotUsingDatabse()
233
    {
234
        $fromCurrency = 'GBP';
235
        $toCurrency = 'EUR';
236
237
        $this->CurrencyConverter = new CurrencyConverterHelper($this->View, [
238
            'database' => false
239
        ]);
240
        $result = $this->CurrencyConverter->rate($fromCurrency, $toCurrency);
241
242
        $this->assertGreaterThan(1, $result);
243
244
        $result = count($this->Table->find('all')->toArray());
245
        $this->assertEquals(1, $result);
246
    }
247
248
    public function tearDown()
249
    {