lithium\tests\cases\analysis\InspectorTest::testIdentifierIntrospection PHP Method

testIdentifierIntrospection() public method

Tests getting reflection information based on a string identifier.
    public function testIdentifierIntrospection()
    {
        $result = Inspector::info(__METHOD__);
        $this->assertEqual(array('public'), $result['modifiers']);
        $this->assertEqual(__FUNCTION__, $result['name']);
        $this->assertNull(Inspector::info('\\lithium\\util'));
        $info = Inspector::info('\\lithium\\analysis\\Inspector');
        $result = str_replace('\\', '/', $info['file']);
        $this->assertNotEmpty(strpos($result, '/analysis/Inspector.php'));
        $this->assertEqual('lithium\\analysis', $info['namespace']);
        $this->assertEqual('Inspector', $info['shortName']);
        $result = Inspector::info('\\lithium\\analysis\\Inspector::$_methodMap');
        $this->assertEqual('_methodMap', $result['name']);
        $expected = 'Maps reflect method names to result array keys.';
        $this->assertEqual($expected, $result['description']);
        $this->assertEqual(array('var' => 'array'), $result['tags']);
        $result = Inspector::info('\\lithium\\analysis\\Inspector::info()', array('modifiers', 'namespace', 'foo'));
        $this->assertEqual(array('modifiers', 'namespace'), array_keys($result));
        $this->assertNull(Inspector::info('\\lithium\\analysis\\Inspector::$foo'));
        $this->assertNull(Inspector::info('\\lithium\\core\\Foo::$foo'));
    }