CurrencyHelperTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A convertTest() 0 12 1
1
<?php
2
3
namespace CountryCurrencyConverter\Tests\src\Services;
4
5
use CountryCurrencyConverter\src\Services\CurrencyHelper;
6
7
class CurrencyHelperTest extends \PHPUnit_Framework_TestCase
8
{
9
    /**
10
     * @test
11
     */
12
    public function convertTest() 
13
    {        
14
        $get = file_get_contents("https://www.google.com/finance/converter?a=10&from=USD&to=INR");
15
        $get = explode("<span class=bld>",$get);
16
        $get = explode("</span>",$get[1]);  
17
        $exceptedResult = preg_replace("/[^0-9\.]/", null, $get[0]);
18
        
19
        $actualResult = CurrencyHelper::convert('USD', 'INR', 10, false);
20
        
21
        
22
        $this->assertEquals($exceptedResult, $actualResult);
23
    }
24
25
}
26