Guest User

Untitled

a guest
Feb 12th, 2013
169
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×