public function BankAccountWithCustomExtensionTest::testBalanceCannotBecomeNegative

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

File

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

Class

BankAccountWithCustomExtensionTest
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();
}