File "BankAccount.php"
Full Path: /www/wwwroot/shphe-en.com/smsapi/api_sdk/vendor/phpunit/php-code-coverage/tests/_files/BankAccount.php
File size: 630 bytes
MIME-type: --
Charset: utf-8
<?php
class BankAccount
{
protected $balance = 0;
public function getBalance()
{
return $this->balance;
}
protected function setBalance($balance)
{
if ($balance >= 0) {
$this->balance = $balance;
} else {
throw new RuntimeException;
}
}
public function depositMoney($balance)
{
$this->setBalance($this->getBalance() + $balance);
return $this->getBalance();
}
public function withdrawMoney($balance)
{
$this->setBalance($this->getBalance() - $balance);
return $this->getBalance();
}
}