/** * @test */ function parseArrayProperty() { $this->parser->setTraverser(new Tx_PhpParser_Parser_Traverser()); $classFileObject = $this->parseFile('ClassWithArrayProperty.php'); $this->assertEquals(count($classFileObject->getFirstClass()->getProperties()), 1); $this->assertNotEquals($classFileObject->getFirstClass()->getProperty('property')->getValue(), array('a' => 'b', '5' => 1223, 'foo' => array('foo' => 'bar'), array(1, 4, 3))); $this->assertEquals($classFileObject->getFirstClass()->getProperty('property')->getValue(), array('a' => 'b', '5' => 1223, 'foo' => array('foo' => 'bar'), array(1, 2, 3))); $this->assertEquals($classFileObject->getFirstClass()->getProperty('property')->getModifierNames(), array('protected')); }
protected function parseFile($fileName) { $classFilePath = t3lib_extmgm::extPath('php_parser_api') . 'Tests/Fixtures/' . $fileName; $classFileObject = $this->parser->parseFile($classFilePath); return $classFileObject; }