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

OfxMovementTest::construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
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