示例#1
0
    }
}
class Testing extends Object
{
    function real_method()
    {
        return 'real_method';
    }
    protected function protected_method()
    {
        return 'protected_method';
    }
}
Testing::extend('Whoa', 'Dude');
$t = new Testing();
$t->testing();
echo "\n";
$t->testing2();
echo "\n";
echo $t->testing2();
echo "\n";
echo $t->send('testing') . ' guy';
echo "\n";
echo $t->respond_to('real_method');
echo "\n";
echo $t->respond_to('testing');
echo "\n";
echo $t->respond_to('protected_method');
echo "\n";
echo $t->respond_to('invalid');
echo "\n";
示例#2
0
 function should_be_able_to_invoke_overloaded_methods()
 {
     $t = new Testing();
     expects($t->testing())->should_be('cooool');
     expects($t->testing2())->should_be('this is a returned value');
 }