/tags/rel-2.0.2/Examples/test-suite/php/smart_pointer_rename_runme.php

# · PHP · 27 lines · 18 code · 6 blank · 3 comment · 0 complexity · 9b166ee24a58e09c1afe67356ca2768c MD5 · raw file

  1. <?php
  2. require "tests.php";
  3. require "smart_pointer_rename.php";
  4. check::classes(array("Foo","Bar"));
  5. check::classmethods("foo",array("ftest1","ftest2","__set","__isset","__get","__construct"));
  6. check::classmethods("bar",array("__deref__","test","ftest1","ftest2","__set","__isset","__get","__construct"));
  7. $foo=new foo();
  8. check::classname("foo",$foo);
  9. $bar=new bar($foo);
  10. check::classname("bar",$bar);
  11. # check foo's ftest1, ftest2
  12. check::equal(1,$foo->ftest1(1),"foo->ftest1");
  13. check::equal(2,$foo->ftest2(1,2),"foo->ftest2");
  14. # check bar's ftest1, ftest2, ftest
  15. check::equal(1,$bar->ftest1(1),"bar->ftest1");
  16. check::equal(2,$bar->ftest2(1,2),"bar->ftest2");
  17. check::equal(3,$bar->test(),"bar->test");
  18. # check deref returns foo
  19. check::classname("foo",$bar->__deref__());
  20. check::done();
  21. ?>