mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-04 05:57:25 +02:00
fixed Proxy tests
This commit is contained in:
@@ -13,12 +13,12 @@ class ProxyTest extends TestCase
|
|||||||
$bankAccount->deposit(30);
|
$bankAccount->deposit(30);
|
||||||
|
|
||||||
// this time balance is being calculated
|
// 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
|
// inheritance allows for BankAccountProxy to behave to an outsider exactly like ServerBankAccount
|
||||||
$bankAccount->deposit(50);
|
$bankAccount->deposit(50);
|
||||||
|
|
||||||
// this time the previously calculated balance is returned again without re-calculating it
|
// 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