class BankAccount

Hierarchy

Expanded class hierarchy of BankAccount

2 string references to 'BankAccount'
PHP_CodeCoverage_Report_CloverTest::testCloverForBankAccountTest in drupal/core/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/CloverTest.php
@covers PHP_CodeCoverage_Report_Clover
PHP_CodeCoverage_Report_FactoryTest::testSomething in drupal/core/vendor/phpunit/php-code-coverage/Tests/PHP/CodeCoverage/Report/FactoryTest.php

File

drupal/core/vendor/phpunit/php-code-coverage/Tests/_files/BankAccount.php, line 2

View source
class BankAccount {
  protected $balance = 0;
  public function getBalance() {
    return $this->balance;
  }
  protected function setBalance($balance) {
    if ($balance >= 0) {
      $this->balance = $balance;
    }
    else {
      throw new RuntimeException();
    }
  }
  public function depositMoney($balance) {
    $this
      ->setBalance($this
      ->getBalance() + $balance);
    return $this
      ->getBalance();
  }
  public function withdrawMoney($balance) {
    $this
      ->setBalance($this
      ->getBalance() - $balance);
    return $this
      ->getBalance();
  }

}

Members