mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-30 19:50:12 +02:00
fixed Proxy tests
This commit is contained in:
@@ -13,12 +13,12 @@ class ProxyTest extends TestCase
|
||||
$bankAccount->deposit(30);
|
||||
|
||||
// this time balance is being calculated
|
||||
$this->assertEquals(0, $bankAccount->getBalance());
|
||||
$this->assertEquals(30, $bankAccount->getBalance());
|
||||
|
||||
// inheritance allows for BankAccountProxy to behave to an outsider exactly like ServerBankAccount
|
||||
$bankAccount->deposit(50);
|
||||
|
||||
// this time the previously calculated balance is returned again without re-calculating it
|
||||
$this->assertEquals(0, $bankAccount->getBalance());
|
||||
$this->assertEquals(30, $bankAccount->getBalance());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user