mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
ValueObject > BankAccount > represents bank account
This commit is contained in:
71
tests/ValueObject/BankAccountTest.php
Normal file
71
tests/ValueObject/BankAccountTest.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\ValueObject;
|
||||
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\Common\ValueObject\BankAccount;
|
||||
|
||||
/**
|
||||
* Test case for the bank account
|
||||
*
|
||||
* @author Meritoo <github@meritoo.pl>
|
||||
* @copyright Meritoo <http://www.meritoo.pl>
|
||||
*/
|
||||
class BankAccountTest extends BaseTestCase
|
||||
{
|
||||
/**
|
||||
* @var BankAccount
|
||||
*/
|
||||
private $emptyBankAccount;
|
||||
|
||||
/**
|
||||
* @var BankAccount
|
||||
*/
|
||||
private $bankAccount;
|
||||
|
||||
public function testConstructor()
|
||||
{
|
||||
static::assertConstructorVisibilityAndArguments(
|
||||
BankAccount::class,
|
||||
OopVisibilityType::IS_PUBLIC,
|
||||
2,
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetAccountNumber()
|
||||
{
|
||||
self::assertSame('', $this->emptyBankAccount->getAccountNumber());
|
||||
self::assertSame('1234567890', $this->bankAccount->getAccountNumber());
|
||||
}
|
||||
|
||||
public function testGetBankName()
|
||||
{
|
||||
self::assertSame('', $this->emptyBankAccount->getBankName());
|
||||
self::assertSame('Bank of America', $this->bankAccount->getBankName());
|
||||
}
|
||||
|
||||
public function testToString()
|
||||
{
|
||||
static::assertSame('', (string)$this->emptyBankAccount);
|
||||
static::assertSame('Bank of America, 1234567890', (string)$this->bankAccount);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->emptyBankAccount = new BankAccount('', '');
|
||||
$this->bankAccount = new BankAccount('Bank of America', '1234567890');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user