Пример #1
0
        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";
echo $t->super_test('sean');
echo "\n";
echo $t->is_a('Testing');
echo "\n";
echo $t->is_a('Invalid');
echo "\n";
Пример #2
0
 function should_dispatch_message_passing_using_method_send()
 {
     $t = new Testing();
     expects($t->send('testing'))->should_be('cooool');
 }