TransactionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_getter_and_setter() 0 28 1
1
<?php
2
3
namespace Tests\Fhp\Model\StatementOfAccount;
4
5
use Fhp\Model\StatementOfAccount\Transaction;
6
7
class TransactionTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function test_getter_and_setter()
10
    {
11
        $obj = new Transaction();
12
13
        $this->assertNull($obj->getAccountNumber());
14
        $this->assertNull($obj->getAmount());
15
        $this->assertNull($obj->getBankCode());
16
        $this->assertNull($obj->getBookingDate());
17
        $this->assertNull($obj->getBookingText());
18
        $this->assertNull($obj->getCreditDebit());
19
        $this->assertNull($obj->getDescription1());
20
        $this->assertNull($obj->getDescription2());
21
        $this->assertNull($obj->getName());
22
        $this->assertNull($obj->getValutaDate());
23
24
        $date = new \DateTime();
25
        $this->assertSame('123456789', $obj->setAccountNumber('123456789')->getAccountNumber());
26
        $this->assertSame(20.00, $obj->setAmount(20.00)->getAmount());
27
        $this->assertSame('123456789', $obj->setBankCode('123456789')->getBankCode());
28
        $this->assertSame($date, $obj->setBookingDate($date)->getBookingDate());
29
        $this->assertSame($date, $obj->setValutaDate($date)->getValutaDate());
30
        $this->assertSame('text', $obj->setBookingText('text')->getBookingText());
31
        $this->assertSame(Transaction::CD_DEBIT, $obj->setCreditDebit(Transaction::CD_DEBIT)->getCreditDebit());
32
        $this->assertSame(Transaction::CD_CREDIT, $obj->setCreditDebit(Transaction::CD_CREDIT)->getCreditDebit());
33
        $this->assertSame('desc1', $obj->setDescription1('desc1')->getDescription1());
34
        $this->assertSame('desc2', $obj->setDescription2('desc2')->getDescription2());
35
        $this->assertSame('name', $obj->setName('name')->getName());
36
    }
37
}
38