-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mschindler
committed
Aug 24, 2016
1 parent
02e54fd
commit 5c213ad
Showing
11 changed files
with
195 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Tests\Fhp\Model; | ||
|
||
use Fhp\Model\SEPAAccount; | ||
|
||
class SEPAAccountTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function test_getter_and_setter() | ||
{ | ||
$obj = new SEPAAccount(); | ||
|
||
$this->assertNull($obj->getAccountNumber()); | ||
$this->assertNull($obj->getBic()); | ||
$this->assertNull($obj->getBlz()); | ||
$this->assertNull($obj->getIban()); | ||
$this->assertNull($obj->getSubAccount()); | ||
|
||
$this->assertSame('123456789', $obj->setAccountNumber('123456789')->getAccountNumber()); | ||
$this->assertSame('123456789', $obj->setBic('123456789')->getBic()); | ||
$this->assertSame('123456789', $obj->setIban('123456789')->getIban()); | ||
$this->assertSame('123456789', $obj->setBlz('123456789')->getBlz()); | ||
$this->assertSame('123456789', $obj->setSubAccount('123456789')->getSubAccount()); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
lib/Tests/Fhp/Model/StatementOfAccount/StatementOfAccountTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Tests\Fhp\Model\StatementOfAccount; | ||
|
||
use Fhp\Model\StatementOfAccount\Statement; | ||
use Fhp\Model\StatementOfAccount\StatementOfAccount; | ||
|
||
class StatementOfAccountTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function test_getter_and_setter() | ||
{ | ||
$obj = new StatementOfAccount(); | ||
$this->assertInternalType('array', $obj->getStatements()); | ||
|
||
$s1 = new Statement(); | ||
$s2 = new Statement(); | ||
|
||
$obj->addStatement($s1); | ||
$this->assertInternalType('array', $obj->getStatements()); | ||
$this->assertCount(1, $obj->getStatements()); | ||
$result = $obj->getStatements(); | ||
$this->assertSame($s1, $result[0]); | ||
|
||
$obj->setStatements(null); | ||
$this->assertInternalType('array', $obj->getStatements()); | ||
$this->assertEmpty($obj->getStatements()); | ||
|
||
$obj->setStatements(array($s1, $s2)); | ||
$this->assertInternalType('array', $obj->getStatements()); | ||
$this->assertCount(2, $obj->getStatements()); | ||
$this->assertSame(array($s1, $s2), $obj->getStatements()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Tests\Fhp\Model\StatementOfAccount; | ||
|
||
use Fhp\Model\StatementOfAccount\Statement; | ||
use Fhp\Model\StatementOfAccount\Transaction; | ||
|
||
class StatementTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function test_getter_and_setter() | ||
{ | ||
$obj = new Statement(); | ||
|
||
$this->assertInternalType('array', $obj->getTransactions()); | ||
$this->assertEmpty($obj->getTransactions()); | ||
$this->assertSame(0.0, $obj->getStartBalance()); | ||
$this->assertNull($obj->getCreditDebit()); | ||
$this->assertNull($obj->getDate()); | ||
|
||
$trx1 = new Transaction(); | ||
$trx2 = new Transaction(); | ||
|
||
$obj->addTransaction($trx1); | ||
$this->assertCount(1, $obj->getTransactions()); | ||
|
||
$obj->addTransaction($trx2); | ||
$this->assertCount(2, $obj->getTransactions()); | ||
|
||
$obj->setTransactions(null); | ||
$this->assertNull($obj->getTransactions()); | ||
|
||
$obj->setTransactions(array()); | ||
$this->assertInternalType('array', $obj->getTransactions()); | ||
$this->assertCount(0, $obj->getTransactions()); | ||
|
||
$trxArray = array($trx1, $trx2); | ||
$obj->setTransactions($trxArray); | ||
$this->assertInternalType('array', $obj->getTransactions()); | ||
$this->assertCount(2, $obj->getTransactions()); | ||
|
||
$obj->setStartBalance(20.00); | ||
$this->assertInternalType('float', $obj->getStartBalance()); | ||
$this->assertSame(20.00, $obj->getStartBalance()); | ||
|
||
$obj->setStartBalance('string'); | ||
$this->assertSame(0.0, $obj->getStartBalance()); | ||
|
||
$obj->setCreditDebit(Statement::CD_CREDIT); | ||
$this->assertSame(Statement::CD_CREDIT, $obj->getCreditDebit()); | ||
|
||
$obj->setCreditDebit(Statement::CD_DEBIT); | ||
$this->assertSame(Statement::CD_DEBIT, $obj->getCreditDebit()); | ||
|
||
$date = new \DateTime(); | ||
$obj->setDate($date); | ||
$this->assertSame($date, $obj->getDate()); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
lib/Tests/Fhp/Model/StatementOfAccount/TransactionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Tests\Fhp\Model\StatementOfAccount; | ||
|
||
use Fhp\Model\StatementOfAccount\Transaction; | ||
|
||
class TransactionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function test_getter_and_setter() | ||
{ | ||
$obj = new Transaction(); | ||
|
||
$this->assertNull($obj->getAccountNumber()); | ||
$this->assertNull($obj->getAmount()); | ||
$this->assertNull($obj->getBankCode()); | ||
$this->assertNull($obj->getBookingDate()); | ||
$this->assertNull($obj->getBookingText()); | ||
$this->assertNull($obj->getCreditDebit()); | ||
$this->assertNull($obj->getDescription1()); | ||
$this->assertNull($obj->getDescription2()); | ||
$this->assertNull($obj->getName()); | ||
$this->assertNull($obj->getValutaDate()); | ||
|
||
$date = new \DateTime(); | ||
$this->assertSame('123456789', $obj->setAccountNumber('123456789')->getAccountNumber()); | ||
$this->assertSame(20.00, $obj->setAmount(20.00)->getAmount()); | ||
$this->assertSame('123456789', $obj->setBankCode('123456789')->getBankCode()); | ||
$this->assertSame($date, $obj->setBookingDate($date)->getBookingDate()); | ||
$this->assertSame($date, $obj->setValutaDate($date)->getValutaDate()); | ||
$this->assertSame('text', $obj->setBookingText('text')->getBookingText()); | ||
$this->assertSame(Transaction::CD_DEBIT, $obj->setCreditDebit(Transaction::CD_DEBIT)->getCreditDebit()); | ||
$this->assertSame(Transaction::CD_CREDIT, $obj->setCreditDebit(Transaction::CD_CREDIT)->getCreditDebit()); | ||
$this->assertSame('desc1', $obj->setDescription1('desc1')->getDescription1()); | ||
$this->assertSame('desc2', $obj->setDescription2('desc2')->getDescription2()); | ||
$this->assertSame('name', $obj->setName('name')->getName()); | ||
} | ||
} |