| Server IP : 68.178.247.200 / Your IP : 216.73.216.58 Web Server : Apache System : Linux p3plzcpnl489463.prod.phx3.secureserver.net 4.18.0-553.126.2.lve.el8.x86_64 #1 SMP Thu May 28 14:12:30 UTC 2026 x86_64 User : x9dppmxs4rgd ( 8559391) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/plugins/wpide/PHP-Parser/test/PHPParser/Tests/Node/Stmt/ |
Upload File : |
<?php
class PHPParser_Tests_Node_Stmt_ClassTest extends PHPUnit_Framework_TestCase
{
public function testIsAbstract() {
$class = new PHPParser_Node_Stmt_Class('Foo', array('type' => PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT));
$this->assertTrue($class->isAbstract());
$class = new PHPParser_Node_Stmt_Class('Foo');
$this->assertFalse($class->isAbstract());
}
public function testIsFinal() {
$class = new PHPParser_Node_Stmt_Class('Foo', array('type' => PHPParser_Node_Stmt_Class::MODIFIER_FINAL));
$this->assertTrue($class->isFinal());
$class = new PHPParser_Node_Stmt_Class('Foo');
$this->assertFalse($class->isFinal());
}
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());
}
}