public function BankAccountTest::testBalanceCannotBecomeNegative

Same name in this branch

@covers BankAccount::withdrawMoney @group balanceCannotBecomeNegative @group specification

File

drupal/core/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php, line 82

Class

BankAccountTest
Tests for the BankAccount class.

Code

public function testBalanceCannotBecomeNegative() {
  try {
    $this->ba
      ->withdrawMoney(1);
  } catch (BankAccountException $e) {
    $this
      ->assertEquals(0, $this->ba
      ->getBalance());
    return;
  }
  $this
    ->fail();
}