本文整理汇总了PHP中check::functions方法的典型用法代码示例。如果您正苦于以下问题:PHP check::functions方法的具体用法?PHP check::functions怎么用?PHP check::functions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类check
的用法示例。
在下文中一共展示了check::functions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sportscars
<?php
require "tests.php";
require "ignore_parameter.php";
// No new functions
check::functions(array(jaguar, lotus, tvr, ferrari));
// No new classes
check::classes(array(sportscars, minicooper, morrisminor, fordanglia, austinallegro));
// now new vars
check::globals(array());
check::equal(jaguar(2, 3.4), "hello", 'jaguar(2,3.4)=="hello"');
check::equal(lotus("eek", 3.4), 101, 'lotus("eek",3.4)==101');
check::equal(tvr("eek", 2), 8.800000000000001, 'tvr("eek",2)==8.8');
check::equal(ferrari(), 101, 'ferrari(2)==101');
$sc = new sportscars();
check::classname("sportscars", $sc);
check::equal($sc->daimler(2, 3.4), "hello", '$sc->daimler(2,3.4)=="hello"');
check::equal($sc->astonmartin("eek", 3.4), 101, '$sc->mastonmartin("eek",3.4)==101');
check::equal($sc->bugatti("eek", 2), 8.800000000000001, '$sc->bugatti("eek",2)==8.8');
check::equal($sc->lamborghini(), 101, '$sc->lamborghini(2)==101');
$mc = new minicooper(2, 3.4);
check::classname("minicooper", $mc);
$mm = new morrisminor("eek", 3.4);
check::classname("morrisminor", $mm);
$fa = new fordanglia("eek", 2);
check::classname("fordanglia", $fa);
$aa = new austinallegro();
check::classname("austinallegro", $aa);
check::done();
示例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: ping
<?php
require "tests.php";
require "director_protected.php";
check::functions(array(foo_pong, foo_s, foo_q, foo_ping, foo_pang, foo_used, foo_cheer, bar_create, bar_callping, bar_callcheer, bar_cheer, bar_pong, bar_used, bar_ping, bar_pang, a_draw, b_draw));
check::classes(array(Foo, Bar, PrivateFoo, A, B, AA, BB));
check::globals(array(bar_a));
class FooBar extends Bar
{
protected function ping()
{
return "FooBar::ping();";
}
}
class FooBar2 extends Bar
{
function ping()
{
return "FooBar2::ping();";
}
function pang()
{
return "FooBar2::pang();";
}
}
class FooBar3 extends Bar
{
function cheer()
{
return "FooBar3::cheer();";
}
示例5: MyIterator
<?php
require "tests.php";
require "php_iterator.php";
check::functions(array(myiterator_rewind, myiterator_key, myiterator_current, myiterator_next, myiterator_valid));
check::classes(array(MyIterator));
// No new global variables.
check::globals(array());
$s = '';
foreach (new MyIterator(1, 6) as $i) {
$s .= $i;
}
check::equal($s, '12345', 'Simple iteration failed');
$s = '';
foreach (new MyIterator(2, 5) as $k => $v) {
$s .= "({$k}=>{$v})";
}
check::equal($s, '(0=>2)(1=>3)(2=>4)', 'Simple iteration failed');
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: MyFoo
<?php
require "tests.php";
require "director_finalizer.php";
// No new functions
check::functions(array(foo_orstatus, deletefoo, getstatus, launder, resetstatus));
// No new classes
check::classes(array(director_finalizer, Foo));
// now new vars
check::globals(array());
class MyFoo extends Foo
{
function __destruct()
{
$this->orStatus(2);
if (method_exists(parent, "__destruct")) {
parent::__destruct();
}
}
}
resetStatus();
$a = new MyFoo();
unset($a);
check::equal(getStatus(), 3, "getStatus() failed #1");
resetStatus();
$a = new MyFoo();
launder($a);
check::equal(getStatus(), 0, "getStatus() failed #2");
unset($a);
check::equal(getStatus(), 3, "getStatus() failed #3");
resetStatus();
示例8: 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()
{
示例9: 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();
示例10: 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;
示例11: ping
<?php
require "tests.php";
require "director_stl.php";
// No new functions
check::functions(array(foo_bar, foo_ping, foo_pong, foo_tping, foo_tpong, foo_pident, foo_vident, foo_vsecond, foo_tpident, foo_tvident, foo_tvsecond, foo_vidents, foo_tvidents));
// No new classes
check::classes(array(Foo));
// now new vars
check::globals(array());
class MyFoo extends Foo
{
function ping($s)
{
return "MyFoo::ping():" . $s;
}
function pident($arg)
{
return $arg;
}
function vident($v)
{
return $v;
}
function vidents($v)
{
return $v;
}
function vsecond($v1, $v2)
{
return $v2;
示例12: Bravo
<?php
require "tests.php";
require "director_frob.php";
// No new functions
check::functions(array(alpha_abs_method, bravo_abs_method, charlie_abs_method, ops_opint, ops_opintstarstarconst, ops_opintamp, ops_opintstar, ops_opconstintintstar, prims_ull, prims_callull, corecallbacks_on3dengineredrawn, corecallbacks_on3dengineredrawn2));
// No new classes
check::classes(array(Alpha, Bravo, Charlie, Delta, Ops, Prims, corePoint3d, coreCallbacks_On3dEngineRedrawnData, coreCallbacksOn3dEngineRedrawnData, coreCallbacks));
// now new vars
check::globals(array(corecallbacks_on3dengineredrawndata__eye, corecallbacks_on3dengineredrawndata__at, corecallbackson3dengineredrawndata__eye, corecallbackson3dengineredrawndata__at));
$foo = new Bravo();
$s = $foo->abs_method();
check::equal($s, "Bravo::abs_method()", "s failed");
check::done();
示例13: incp
<?php
require "tests.php";
require "argout.php";
check::functions(array(incp, incr, inctr, new_intp, copy_intp, delete_intp, intp_assign, intp_value, voidhandle, handle));
$ip = copy_intp(42);
check::equal(42, incp($ip), "42==incp({$ip})");
check::equal(43, intp_value($ip), "43={$ip}");
$p = copy_intp(2);
check::equal(2, incp($p), "2==incp({$p})");
check::equal(3, intp_value($p), "3=={$p}");
$r = copy_intp(7);
check::equal(7, incr($r), "7==incr({$r})");
check::equal(8, intp_value($r), "8=={$r}");
$tr = copy_intp(4);
check::equal(4, inctr($tr), "4==incr({$tr})");
check::equal(5, intp_value($tr), "5=={$tr}");
# Check the voidhandle call, first with null
unset($handle);
# FIXME: Call-time pass-by-reference has been deprecated for ages, and was
# removed in PHP 5.4. We need to rework
#voidhandle(&$handle);
#check::resource($handle,"_p_void",'$handle is not _p_void');
#$handledata=handle($handle);
#check::equal($handledata,"Here it is","\$handledata != \"Here it is\"");
unset($handle);
voidhandle($handle);
check::isnull($handle, '$handle not null');
check::done();
示例14: Foo
<?php
require "tests.php";
require "director_default.php";
// No new functions
check::functions(array(foo_msg, foo_getmsg, bar_msg, bar_getmsg, defaultsbase_defaultargs, defaultsderived_defaultargs));
// No new classes
check::classes(array(Foo, Bar, DefaultsBase, DefaultsDerived));
// now new vars
check::globals(array());
$f = new Foo();
$f = new Foo(1);
$f = new Bar();
$f = new Bar(1);
check::done();
示例15:
<?php
require "tests.php";
require "template_arg_typename.php";
// No new functions
check::functions(array());
// No new classes
check::classes(array(UnaryFunction_bool_bool, BoolUnaryFunction_bool));
$ufbb = new unaryfunction_bool_bool();
check::is_a($ufbb, "unaryfunction_bool_bool");
unset($whatisthis);
$bufb = new boolunaryfunction_bool(&$whatisthis);
check::is_a($bufb, "boolunaryfunction_bool");
check::done();