<?php


class WactReflectionMethodTester {
    function foo($x) {
    }
}

class WactReflectionMethodTestCase extends Wact_Test_Case {

    function testGetDeclaringClass() {
        $reflector = new Wact_Reflection_Class('WactReflectionMethodTester');
        $method = $reflector->getMethod('foo');
        $class = $method->getDeclaringClass();
        $this->assertIsA($class, 'Wact_Reflection_Class');
        $this->assertEqual($class->getName(), 'WactReflectionMethodTester');
    }
    
    function testGetParameters() {
        $class = new Wact_Reflection_Class('WactReflectionMethodTester');
        $method = $class->getMethod('foo');
        foreach($method->getParameters() as $name => $parameter) {
            $this->assertIsA($parameter, 'Wact_Reflection_Parameter');
            $this->assertEqual($parameter->getName(), 'x');
        }
        
    }

}    
?>