Add class method check in Test Cases.
Currently they check flat functions at check::functions()
This commit is contained in:
parent
6b8aae188f
commit
2e5f0fac52
11 changed files with 610 additions and 12 deletions
|
|
@ -3,10 +3,8 @@
|
|||
require "tests.php";
|
||||
require "add_link.php";
|
||||
|
||||
// No new functions, except the flat functions
|
||||
check::functions(array(new_foo,foo_blah));
|
||||
|
||||
check::classes(array(Foo));
|
||||
check::classmethods(Foo,array(__construct,__set,__isset,__get,blah));
|
||||
|
||||
$foo=new foo();
|
||||
check::is_a($foo,foo);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@
|
|||
require "tests.php";
|
||||
require "arrays_global.php";
|
||||
|
||||
check::functions(array(test_a,test_b,new_simplestruct,new_material));
|
||||
check::functions(array(test_a,test_b));
|
||||
check::classes(array(arrays_global,SimpleStruct,Material));
|
||||
check::classmethods(SimpleStruct,array(__construct,__set,__isset,__get,double_field_set,double_field_get));
|
||||
check::classmethods(Material,array(__construct,__set,__isset,__get));
|
||||
|
||||
// The size of array_c is 2, but the last byte is \0, so we can only store a
|
||||
// single byte string in it.
|
||||
check::set(array_c,"Z");
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@
|
|||
require "tests.php";
|
||||
require "arrays_global_twodim.php";
|
||||
|
||||
check::functions(array(fn_taking_arrays,get_2d_array,new_simplestruct,new_material));
|
||||
check::functions(array(fn_taking_arrays,get_2d_array));
|
||||
check::classes(array(arrays_global_twodim,SimpleStruct,Material));
|
||||
check::classmethods(SimpleStruct,array(__construct,__set,__isset,__get,double_field_set,double_field_get));
|
||||
check::classmethods(Material,array(__construct,__set,__isset,__get));
|
||||
|
||||
$a1=array(10,11,12,13);
|
||||
$a2=array(14,15,16,17);
|
||||
$a=array($a1,$a2);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
require "tests.php";
|
||||
require "arrays_scope.php";
|
||||
|
||||
// New functions
|
||||
check::functions(array(new_bar,bar_blah));
|
||||
// New classes
|
||||
check::classes(array(arrays_scope,Bar));
|
||||
// New functions
|
||||
check::classmethods(Bar,array(__construct,__set,__isset,__get,blah));
|
||||
|
||||
$bar=new bar();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
require "tests.php";
|
||||
require "casts.php";
|
||||
|
||||
// No new functions
|
||||
check::functions(array(new_a,a_hello,new_b));
|
||||
// No new classes
|
||||
check::classes(array(A,B));
|
||||
// New functions
|
||||
check::classmethods(A,array(__construct,__set,__isset,__get,hello));
|
||||
check::classmethods(B,array(__construct,__set,__isset,__get,hello));
|
||||
// now new vars
|
||||
check::globals(array());
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,13 @@
|
|||
require "tests.php";
|
||||
require "class_ignore.php";
|
||||
|
||||
check::functions(array(do_blah,new_bar,bar_blah,new_boo,boo_away,new_far,new_hoo));
|
||||
check::functions(array(do_blah));
|
||||
check::classes(array(class_ignore,Bar,Boo,Far,Hoo));
|
||||
// New functions
|
||||
check::classmethods(Bar,array(__construct,__set,__isset,__get,blah));
|
||||
check::classmethods(Boo,array(__construct,__set,__isset,__get,away));
|
||||
check::classmethods(Far,array(__construct,__set,__isset,__get));
|
||||
check::classmethods(Hoo,array(__construct,__set,__isset,__get));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,15 @@
|
|||
require "tests.php";
|
||||
require "cpp_basic.php";
|
||||
|
||||
// New functions
|
||||
check::functions(array(foo_func1,foo_func2,foo___str__,foosubsub___str__,bar_test,bar_testfoo,get_func1_ptr,get_func2_ptr,test_func_ptr,fl_window_show));
|
||||
// New Functions
|
||||
check::functions(array(get_func1_ptr,get_func2_ptr,test_func_ptr));
|
||||
// New classes
|
||||
check::classes(array(cpp_basic,Foo,FooSub,FooSubSub,Bar,Fl_Window));
|
||||
// New Class functions
|
||||
check::classmethods(Foo,array(__construct,__set,__isset,__get,func1,func2,__str__));
|
||||
check::classmethods(foosubsub,array(__construct,__set,__isset,__get,__str__));
|
||||
check::classmethods(bar,array(__construct,__set,__isset,__get,test,testfoo));
|
||||
check::classmethods(Fl_Window,array(__construct,__set,__isset,__get,show));
|
||||
|
||||
$f = new Foo(3);
|
||||
$f->func_ptr = get_func1_ptr();
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ class check {
|
|||
}
|
||||
|
||||
function functions($functions) {
|
||||
return TRUE;
|
||||
if (! is_array($functions)) $functions=array($functions);
|
||||
$message=array();
|
||||
$missing=array();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue