public function __construct(\PHPParser_Node_Stmt_Class $class, \PHPParser_Node_Stmt_Trait $trait, \PHPParser_Node_Stmt_TraitUse $traitUse) { foreach ($class->getMethods() as $method) { $this->classMethods[] = $method->name; } $this->trait = $trait; $this->traitUse = $traitUse; }
public function testGetMethods() { $methods = array(new PHPParser_Node_Stmt_ClassMethod('foo'), new PHPParser_Node_Stmt_ClassMethod('bar'), new PHPParser_Node_Stmt_ClassMethod('fooBar')); $class = new PHPParser_Node_Stmt_Class('Foo', array('stmts' => array(new PHPParser_Node_Stmt_TraitUse(array()), $methods[0], new PHPParser_Node_Stmt_Const(array()), $methods[1], new PHPParser_Node_Stmt_Property(0, array()), $methods[2]))); $this->assertEquals($methods, $class->getMethods()); }