Completed
Push — master ( 046d7f...f5773e )
by Adelar
02:28
created

OfxParseTest::caixa()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
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
use Adelarcubs\OFXParser\OfxMovement;
9
10
/**
11
 *
12
 * @author Adelar Tiemann Junior <[email protected]>
13
 */
14
class OfxParseTest extends PHPUnit_Framework_TestCase
15
{
16
17
    /**
18
     * @test
19
     * @expectedException Exception
20
     */
21
    public function wrongXmlFormat()
22
    {
23
        $ofx = OfxParser::loadOfx('<OFX><root></rot></OFX>');
24
        $this->assertNull($ofx);
25
    }
26
27
    /**
28
     * @test
29
     */
30 View Code Duplication
    public function itau()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32
        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_itau.ofx');
33
        $this->assertInstanceOf(Ofx::class, $ofx);
34
35
        $this->assertContainsOnlyInstancesOf(OfxMovement::class, $ofx->getMovements());
36
    }
37
38
    /**
39
     * @test
40
     */
41 View Code Duplication
    public function santander()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
42
    {
43
        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_santander.ofx');
44
        $this->assertInstanceOf(Ofx::class, $ofx);
45
46
        $this->assertContainsOnlyInstancesOf(OfxMovement::class, $ofx->getMovements());
47
    }
48
49
    /**
50
     * @test
51
     */
52 View Code Duplication
    public function caixa()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
53
    {
54
        $ofx = OfxParser::loadOfx(__DIR__ . '/fixtures/extrato_caixa.ofx');
55
        $this->assertInstanceOf(Ofx::class, $ofx);
56
57
        $this->assertContainsOnlyInstancesOf(OfxMovement::class, $ofx->getMovements());
58
    }
59
}
60