Advertisement
Guest User

Untitled

a guest
Feb 12th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2. namespace Blog;
  3.  
  4. class DecoratorWithAnotherGetId extends Decorator
  5. {
  6.     public function getId()
  7.     {
  8.         return 1000 + $this->class->getId();
  9.     }
  10. }
  11.  
  12. // tests
  13.  
  14. class DecoratorWithAnotherGetIdTest extends PHPUnit_Framework_TestCase
  15. {
  16.     public function testOverridingRender()
  17.     {
  18.         $decorator = new DecoratorWithAnotherGetId(new Object());
  19.         $decorator->setId(666);
  20.         $this->assertEquals('decorator id = 1666', $decorator->render());
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement