You are here

protected function BankAccount::setBalance in Zircon Profile 8

Same name in this branch
  1. 8 vendor/phpunit/phpunit/tests/_files/BankAccount.php \BankAccount::setBalance()
  2. 8 vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php \BankAccount::setBalance()
Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/_files/BankAccount.php \BankAccount::setBalance()
  2. 8.0 vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php \BankAccount::setBalance()
4 calls to BankAccount::setBalance()
BankAccount::depositMoney in vendor/phpunit/phpunit/tests/_files/BankAccount.php
Deposits an amount of money to the bank account.
BankAccount::depositMoney in vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php
BankAccount::withdrawMoney in vendor/phpunit/phpunit/tests/_files/BankAccount.php
Withdraws an amount of money from the bank account.
BankAccount::withdrawMoney in vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php

File

vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php, line 11

Class

BankAccount

Code

protected function setBalance($balance) {
  if ($balance >= 0) {
    $this->balance = $balance;
  }
  else {
    throw new RuntimeException();
  }
}