本文整理汇总了PHP中check::classes方法的典型用法代码示例。如果您正苦于以下问题:PHP check::classes方法的具体用法?PHP check::classes怎么用?PHP check::classes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类check
的用法示例。
在下文中一共展示了check::classes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ping
<?php
require "tests.php";
require "director_basic.php";
// No new functions
check::functions(array(foo_ping, foo_pong, foo_get_self, a_f, a_rg, a1_ff, myclass_method, myclass_vmethod, myclass_pmethod, myclass_cmethod, myclass_get_self, myclass_call_pmethod, myclasst_i_method));
// No new classes
check::classes(array(Foo, A, A1, Bar, MyClass, MyClassT_i));
// now new vars
check::globals(array(bar_x));
class PhpFoo extends Foo
{
function ping()
{
return "PhpFoo::ping()";
}
}
$a = new PhpFoo();
check::equal($a->ping(), "PhpFoo::ping()", "ping failed");
check::equal($a->pong(), "Foo::pong();PhpFoo::ping()", "pong failed");
$b = new Foo();
check::equal($b->ping(), "Foo::ping()", "ping failed");
check::equal($b->pong(), "Foo::pong();Foo::ping()", "pong failed");
$a = new A1(1);
check::equal($a->rg(2), 2, "rg failed");
class PhpClass extends MyClass
{
function vmethod($b)
{
$b->x = $b->x + 31;
return $b;
示例2: array
<?php
require "tests.php";
require "arrays_global_twodim.php";
check::functions(array(fn_taking_arrays, get_2d_array, new_simplestruct, new_material));
check::classes(array(arrays_global_twodim, SimpleStruct, Material));
check::globals(array(array_c, array_sc, array_uc, array_s, array_us, array_i, array_ui, array_l, array_ul, array_ll, array_f, array_d, array_struct, array_structpointers, array_ipointers, array_enum, array_enumpointers, array_const_i, chitmat, hitmat_val, hitmat, simplestruct_double_field));
$a1 = array(10, 11, 12, 13);
$a2 = array(14, 15, 16, 17);
$a = array($a1, $a2);
$_a = check::get(array_const_i);
for ($x = 0; $x < count($a1); $x++) {
for ($y = 0; $y < 2; $y++) {
check::equal($a[$y][$x], get_2d_array($_a, $y, $x), "check array {$x},{$y}");
}
}
check::done();
示例3: chops
<?php
require "tests.php";
require "enum_scope_template.php";
check::classes(array("enum_scope_template", "TreeInt"));
check::functions("chops");
check::equal(0, TreeInt_Oak, "0==TreeInt_Oak");
check::equal(1, TreeInt_Fir, "1==TreeInt_Fir");
check::equal(2, TreeInt_Cedar, "2==TreeInt_Cedar");
check::equal(TreeInt_Oak, chops(TreeInt_Oak), "TreeInt_Oak==chops(TreeInt_Oak)");
check::equal(TreeInt_Fir, chops(TreeInt_Fir), "TreeInt_Fir==chops(TreeInt_Fir)");
check::equal(TreeInt_Cedar, chops(TreeInt_Cedar), "TreeInt_Cedar==chops(TreeInt_Cedar)");
check::done();
示例4: ProjectFoo
<?php
require "tests.php";
require "prefix.php";
// No new functions
check::functions(array(foo_get_self));
// No new classes
check::classes(array(ProjectFoo));
// now new vars
check::globals(array());
$f = new ProjectFoo();
// This resulted in "Fatal error: Class 'Foo' not found"
$f->get_self();
check::done();
示例5: Derived
<?php
require "tests.php";
require "director_thread.php";
// No new functions
check::functions(array(millisecondsleep, foo_stop, foo_run, foo_do_foo));
// No new classes
check::classes(array(director_thread, Foo));
// now new vars
check::globals(array(foo_val));
class Derived extends Foo
{
function do_foo()
{
$this->val = $this->val - 1;
}
}
$d = new Derived();
$d->run();
if ($d->val >= 0) {
check::fail($d->val);
}
$d->stop();
check::done();
示例6: B
<?php
require "tests.php";
require "director_string.php";
// No new functions
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));
// No new classes
check::classes(array(A, StringVector));
// now new vars
check::globals(array(a, a_call, a_m_strings, stringvector));
class B extends A
{
function get_first()
{
return parent::get_first() . " world!";
}
function process_text($string)
{
parent::process_text($string);
$this->smem = "hello";
}
}
$b = new B("hello");
$b->get(0);
check::equal($b->get_first(), "hello world!", "get_first failed");
$b->call_process_func();
check::equal($b->smem, "hello", "smem failed");
check::done();
示例7: Bar
<?php
require "tests.php";
require "conversion_namespace.php";
check::classes(array("Foo", "Bar"));
$bar = new Bar();
check::classname("bar", $bar);
$foo = $bar->toFoo();
check::classname("foo", $foo);
check::done();
示例8: bar
<?php
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::classes(array(class_ignore, Bar, Boo, Far, Hoo));
// No new vars
check::globals(array());
$bar = new bar();
do_blah($bar);
check::classparent($bar, "");
check::done();
示例9: id
<?php
require "tests.php";
require "director_classic.php";
// No new functions
check::functions(array(being_id, person_id, child_id, grandchild_id, caller_delcallback, caller_setcallback, caller_resetcallback, caller_call, caller_baseclass));
// No new classes
check::classes(array(Being, Person, Child, GrandChild, OrphanPerson, OrphanChild, Caller));
// now new vars
check::globals(array());
class TargetLangPerson extends Person
{
function id()
{
$identifier = "TargetLangPerson";
return $identifier;
}
}
class TargetLangChild extends Child
{
function id()
{
$identifier = "TargetLangChild";
return $identifier;
}
}
class TargetLangGrandChild extends GrandChild
{
function id()
{
$identifier = "TargetLangGrandChild";
示例10: flim
<?php
require "tests.php";
require "sym.php";
// No new functions
check::functions(array());
// No new classes
check::classes(array(flim, flam));
// now new vars
check::globals(array());
$flim = new flim();
$flam = new flam();
check::equal($flim->hulahoops(), "flim-jam", "flim()->hulahoops==flim-jam");
check::equal($flim->jar(), "flim-jar", "flim()->jar==flim-jar");
check::equal($flam->jam(), "flam-jam", "flam()->jam==flam-jam");
check::equal($flam->jar(), "flam-jar", "flam()->jar==flam-jar");
check::done();
示例11: Bar
<?php
require "tests.php";
require "import_nomodule.php";
// No new functions
check::functions(array(create_foo, delete_foo, test1, is_python_builtin));
// No new classes
check::classes(array(import_nomodule, Bar));
// now new vars
check::globals(array());
$f = import_nomodule::create_Foo();
import_nomodule::test1($f, 42);
import_nomodule::delete_Foo($f);
$b = new Bar();
import_nomodule::test1($b, 37);
check::done();
示例12: array
<?php
require "tests.php";
require "rename_scope.php";
check::classes(array("rename_scope", "Interface_UP", "Interface_BP", "Natural_UP", "Natural_BP", "Bucket"));
check::classmethods("Interface_UP", array("__construct", "__set", "__isset", "__get"));
check::classmethods("Interface_BP", array("__construct", "__set", "__isset", "__get"));
check::classmethods("Natural_UP", array("__construct", "__set", "__isset", "__get", "rtest"));
check::classmethods("Natural_BP", array("__construct", "__set", "__isset", "__get", "rtest"));
check::classparent("Natural_UP", "Interface_UP");
check::classparent("Natural_BP", "Interface_BP");
check::done();
示例13: foo
<?php
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));
$foo = new foo();
check::is_a($foo, foo);
$foo_blah = $foo->blah();
check::is_a($foo_blah, foo);
//fails, can't be called as a class method, should allow and make it nil?
//$class_foo_blah=foo::blah();
//check::is_a($class_foo_blah,foo);
check::done();
示例14: A
<?php
require "tests.php";
require "director_nested.php";
// No new functions
check::functions(array(foo_int_advance, foo_int_do_advance, bar_step, bar_do_advance, bar_do_step, foobar_int_get_value, foobar_int_get_name, foobar_int_name, foobar_int_get_self, foobar_int_do_advance, foobar_int_do_step));
// No new classes
check::classes(array(Foo_int, Bar, FooBar_int));
// now new vars
check::globals(array());
class A extends FooBar_int
{
function do_step()
{
return "A::do_step;";
}
function get_value()
{
return "A::get_value";
}
}
$a = new A();
check::equal($a->step(), "Bar::step;Foo::advance;Bar::do_advance;A::do_step;", "Bad A virtual resolution");
class B extends FooBar_int
{
function do_advance()
{
return "B::do_advance;" . $this->do_step();
}
function do_step()
{
示例15:
<?php
require "tests.php";
require "template_construct.php";
check::classes(array(Foo_int));
$foo_int = new foo_int(3);
check::is_a($foo_int, "foo_int", "Made a foo_int");
check::done();