Completed
Push — master ( e3be67...2f9429 )
by Adelar
02:35
created

OfxParseTest::parseDiferentOFxBankFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace Adelarcubs\OFXParser;
3
4
use PHPUnit_Framework_TestCase;
5
use SimpleXMLElement;
6
use Adelarcubs\OFXParser\Ofx;
7
use Adelarcubs\OFXParser\OfxParser;
8
9
/**
10
 *
11
 * @author Adelar Tiemann Junior <[email protected]>
12
 */
13
class OfxParseTest extends PHPUnit_Framework_TestCase
14
{
15
16
    /**
17
     * @test
18
     * @expectedException Exception
19
     */
20
    public function wrongXmlFormat()
21
    {$a=new OfxParser('<OFX><root></rot></OFX>');}
0 ignored issues
show
Unused Code introduced by
$a is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
22
23
    /**
24
     * @test
25
     * @dataProvider ofxDataProvider
26
     */
27
    public function parseDiferentOFxBankFile($file)
28
    {
29
        // $ofx = Ofx::loadFromFile($file);
30
        // $this->assertInstanceOf(Ofx::class, $ofx);
31
        $parser = new OfxParser($file);
32
        $this->assertInstanceOf(Ofx::class, $parser->getOfx());
33
    }
34
35
    public function ofxDataProvider()
36
    {
37
        return [
38
            [
39
                __DIR__ . '/fixtures/data.ofx'
40
            ],
41
            [
42
                __DIR__ . '/fixtures/data2.ofx'
43
            ],
44
            [
45
                __DIR__ . '/fixtures/caixa_julho.ofx'
46
            ],
47
            [
48
                __DIR__ . '/fixtures/extrato_itau_maio.ofx'
49
            ]
50
        ];
51
    }
52
}
53