%s
BankAccount.php
Code Coverage
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
CRAP
50.00% covered (danger)
50.00%
5 / 10
BankAccount
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
8.12
50.00% covered (danger)
50.00%
5 / 10
getBalance
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
setBalance
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 5
depositMoney
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
withdrawMoney
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
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();
Legend
Executed Not Executed Dead Code
Generated by php-code-coverage %s using %s at %s.