import source from 1.3.40
[external/swig.git] / Examples / test-suite / php / director_string_runme.php
1 <?php
2
3 require "tests.php";
4 require "director_string.php";
5
6 // No new functions
7 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));
8 // No new classes
9 check::classes(array(A,StringVector));
10 // now new vars
11 check::globals(array(a,a_call,a_m_strings,stringvector));
12
13 class B extends A {
14   function get_first() {
15     return parent::get_first() . " world!";
16   }
17
18   function process_text($string) {
19     parent::process_text($string);
20     $this->smem = "hello";
21   }
22 }
23
24 $b = new B("hello");
25
26 $b->get(0);
27 check::equal($b->get_first(),"hello world!", "get_first failed");
28
29 $b->call_process_func();
30
31 check::equal($b->smem, "hello", "smem failed");
32
33 check::done();
34 ?>