public function testCanGetValuesAsClassesUsingStaticMethods() { $this->assertInstanceOf('SAccounts\\AccountType', AccountType::REAL()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::CR()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::DR()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::ASSET()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::BANK()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::CUSTOMER()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::EXPENSE()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::INCOME()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::LIABILITY()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::EQUITY()); $this->assertInstanceOf('SAccounts\\AccountType', AccountType::SUPPLIER()); }
public function accountTypesThatHaveBalance() { return [[AccountType::DR()], [AccountType::CR()], [AccountType::ASSET()], [AccountType::LIABILITY()], [AccountType::BANK()], [AccountType::CUSTOMER()], [AccountType::EQUITY()], [AccountType::EXPENSE()], [AccountType::INCOME()], [AccountType::SUPPLIER()]]; }
public function invalidAccountTypes() { return array(array(AccountType::ASSET()), array(AccountType::BANK()), array(AccountType::CUSTOMER()), array(AccountType::EQUITY()), array(AccountType::EXPENSE()), array(AccountType::INCOME()), array(AccountType::LIABILITY()), array(AccountType::REAL()), array(AccountType::SUPPLIER())); }
public function testYouCanDeleteAnAccountIfItsBalanceIsZero() { $ac1 = new Account($this->sut, new Nominal('9998'), AccountType::ASSET(), new StringType('Asset')); $this->sut->addAccount($ac1); $ac1->debit(Factory::create($this->sut->getOrg()->getCurrencyCode())); $this->sut->delAccount($ac1->getId()); $this->assertFalse($this->sut->hasAccount($ac1->getId())); $ac2 = new Account($this->sut, new Nominal('9999'), AccountType::LIABILITY(), new StringType('Asset')); $this->sut->addAccount($ac2); $ac1->credit(Factory::create($this->sut->getOrg()->getCurrencyCode())); $this->sut->delAccount($ac2->getId()); $this->assertFalse($this->sut->hasAccount($ac2->getId())); }