You are here

public function BankAccountTest::testBalanceCannotBecomeNegative in Zircon Profile 8

Same name in this branch
  1. 8 vendor/phpunit/phpunit/tests/_files/BankAccountTest.php \BankAccountTest::testBalanceCannotBecomeNegative()
  2. 8 vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php \BankAccountTest::testBalanceCannotBecomeNegative()
Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/_files/BankAccountTest.php \BankAccountTest::testBalanceCannotBecomeNegative()
  2. 8.0 vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php \BankAccountTest::testBalanceCannotBecomeNegative()

@covers BankAccount::withdrawMoney

File

vendor/phpunit/php-code-coverage/tests/_files/BankAccountTest.php, line 24

Class

BankAccountTest

Code

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