Completed
Push — master ( cb517e...d88e38 )
by Adelar
02:26
created

OfxMovementTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A construct() 0 12 1
1
<?php
2
namespace Adelarcubs\OFXParser;
3
4
use PHPUnit_Framework_TestCase;
5
use SimpleXMLElement;
6
use Adelarcubs\OFXParser\OfxMovement;
7
use DateTime;
8
9
/**
10
 *
11
 * @author Adelar Tiemann Junior <[email protected]>
12
 */
13
class OfxMovementTest extends PHPUnit_Framework_TestCase
14
{
15
16
    /**
17
     * @test
18
     */
19
    public function construct()
20
    {
21
        $xml = simplexml_load_string('<OFX><FITID>123</FITID><MEMO>Alguma Descrição</MEMO><TRNAMT>123,99</TRNAMT><DTPOSTED>20160102</DTPOSTED></OFX>');
22
        $ofxMovement = new OfxMovement($xml);
23
24
        $this->assertInstanceOf(OfxMovement::class, $ofxMovement);
25
26
        $this->assertEquals('Alguma Descrição', $ofxMovement->getDescription());
27
        $this->assertEquals(123.99, $ofxMovement->getAmount());
28
        $this->assertInstanceOf(DateTime::class, $ofxMovement->getDueDate());
29
        $this->assertEquals('123', $ofxMovement->getDocument());
30
    }
31
}
32