public function BankAccountTest::testBalanceCannotBecomeNegative2

Same name in this branch
  1. 8.x drupal/core/vendor/phpunit/php-code-coverage/Tests/_files/BankAccountTest.php \BankAccountTest::testBalanceCannotBecomeNegative2()
  2. 8.x drupal/core/vendor/phpunit/phpunit/Tests/_files/BankAccountTest.php \BankAccountTest::testBalanceCannotBecomeNegative2()

@covers BankAccount::depositMoney @group balanceCannotBecomeNegative @group specification

File

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

Class

BankAccountTest
Tests for the BankAccount class.

Code

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