PageRenderTime 46ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/php/director_string_runme.php

#
PHP | 34 lines | 22 code | 9 blank | 3 comment | 0 complexity | 6b83e63df4be0fff9a63651ed942f371 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. <?php
  2. require "tests.php";
  3. require "director_string.php";
  4. // No new functions
  5. check::functions(array(a_get_first,a_call_get_first,a_string_length,a_process_text,a_call_process_func,stringvector_size,stringvector_is_empty,stringvector_clear,stringvector_push,stringvector_pop,stringvector_capacity,stringvector_reserve));
  6. // No new classes
  7. check::classes(array(A,StringVector));
  8. // now new vars
  9. check::globals(array(a,a_call,a_m_strings,stringvector));
  10. class B extends A {
  11. function get_first() {
  12. return parent::get_first() . " world!";
  13. }
  14. function process_text($string) {
  15. parent::process_text($string);
  16. $this->smem = "hello";
  17. }
  18. }
  19. $b = new B("hello");
  20. $b->get(0);
  21. check::equal($b->get_first(),"hello world!", "get_first failed");
  22. $b->call_process_func();
  23. check::equal($b->smem, "hello", "smem failed");
  24. check::done();
  25. ?>