Annotation of embedaddon/php/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ReflectionMethod constructor errors
                      3: --CREDITS--
                      4: Robin Fernandes <robinf@php.net>
                      5: Steve Seear <stevseea@php.net>
                      6: --FILE--
                      7: <?php
                      8: 
                      9: class TestClass
                     10: {
                     11:     public function foo() {
                     12:     }
                     13: }
                     14: 
                     15: 
                     16: try {
                     17:        echo "Too few arguments:\n";
                     18:        $methodInfo = new ReflectionMethod();
                     19: } catch (Exception $e) {
                     20:        print $e->__toString();
                     21: }
                     22: try {
                     23:        echo "\nToo many arguments:\n";
                     24:        $methodInfo = new ReflectionMethod("TestClass", "foo", true);
                     25: } catch (Exception $e) {
                     26:        print $e->__toString();
                     27: }
                     28: 
                     29: ?>
                     30: --EXPECTF--
                     31: Too few arguments:
                     32: 
                     33: Warning: ReflectionMethod::__construct() expects exactly 1 parameter, 0 given in %s on line 12
                     34: 
                     35: Too many arguments:
                     36: 
                     37: Warning: ReflectionMethod::__construct() expects exactly 1 parameter, 3 given in %s on line 18

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>