Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Blog;
- class DecoratorWithAnotherGetId extends Decorator
- {
- public function getId()
- {
- return 1000 + $this->class->getId();
- }
- }
- // tests
- class DecoratorWithAnotherGetIdTest extends PHPUnit_Framework_TestCase
- {
- public function testOverridingRender()
- {
- $decorator = new DecoratorWithAnotherGetId(new Object());
- $decorator->setId(666);
- $this->assertEquals('decorator id = 1666', $decorator->render());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement