X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fnikic%2Fphp-parser%2Ftest%2FPhpParser%2FBuilder%2FClassTest.php;fp=vendor%2Fnikic%2Fphp-parser%2Ftest%2FPhpParser%2FBuilder%2FClassTest.php;h=fe324d766ca9f1846ebc8472d2433df43f2876b8;hp=0f7418212ed87f9ea361fa7b6f2c80362245c1e6;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/nikic/php-parser/test/PhpParser/Builder/ClassTest.php b/vendor/nikic/php-parser/test/PhpParser/Builder/ClassTest.php index 0f7418212..fe324d766 100644 --- a/vendor/nikic/php-parser/test/PhpParser/Builder/ClassTest.php +++ b/vendor/nikic/php-parser/test/PhpParser/Builder/ClassTest.php @@ -1,4 +1,4 @@ -assertEquals( - new Stmt\Class_('SomeLogger', array( + new Stmt\Class_('SomeLogger', [ 'extends' => new Name('BaseLogger'), - 'implements' => array( + 'implements' => [ new Name('Namespaced\Logger'), new Name('SomeInterface'), new Name\FullyQualified('Fully\Qualified'), new Name\Relative('NamespaceRelative'), - ), - )), + ], + ]), $node ); } @@ -42,9 +43,9 @@ class ClassTest extends \PHPUnit_Framework_TestCase ; $this->assertEquals( - new Stmt\Class_('Test', array( + new Stmt\Class_('Test', [ 'flags' => Stmt\Class_::MODIFIER_ABSTRACT - )), + ]), $node ); } @@ -56,9 +57,9 @@ class ClassTest extends \PHPUnit_Framework_TestCase ; $this->assertEquals( - new Stmt\Class_('Test', array( + new Stmt\Class_('Test', [ 'flags' => Stmt\Class_::MODIFIER_FINAL - )), + ]), $node ); } @@ -67,24 +68,24 @@ class ClassTest extends \PHPUnit_Framework_TestCase $method = new Stmt\ClassMethod('testMethod'); $property = new Stmt\Property( Stmt\Class_::MODIFIER_PUBLIC, - array(new Stmt\PropertyProperty('testProperty')) + [new Stmt\PropertyProperty('testProperty')] ); - $const = new Stmt\ClassConst(array( + $const = new Stmt\ClassConst([ new Node\Const_('TEST_CONST', new Node\Scalar\String_('ABC')) - )); - $use = new Stmt\TraitUse(array(new Name('SomeTrait'))); + ]); + $use = new Stmt\TraitUse([new Name('SomeTrait')]); $node = $this->createClassBuilder('Test') ->addStmt($method) ->addStmt($property) - ->addStmts(array($const, $use)) + ->addStmts([$const, $use]) ->getNode() ; $this->assertEquals( - new Stmt\Class_('Test', array( - 'stmts' => array($use, $const, $property, $method) - )), + new Stmt\Class_('Test', [ + 'stmts' => [$use, $const, $property, $method] + ]), $node ); } @@ -100,11 +101,11 @@ DOC; ->getNode(); $this->assertEquals( - new Stmt\Class_('Test', array(), array( - 'comments' => array( + new Stmt\Class_('Test', [], [ + 'comments' => [ new Comment\Doc($docComment) - ) - )), + ] + ]), $class ); @@ -113,11 +114,11 @@ DOC; ->getNode(); $this->assertEquals( - new Stmt\Class_('Test', array(), array( - 'comments' => array( + new Stmt\Class_('Test', [], [ + 'comments' => [ new Comment\Doc($docComment) - ) - )), + ] + ]), $class ); } @@ -128,7 +129,7 @@ DOC; */ public function testInvalidStmtError() { $this->createClassBuilder('Test') - ->addStmt(new Stmt\Echo_(array())) + ->addStmt(new Stmt\Echo_([])) ; } @@ -152,10 +153,10 @@ DOC; /** * @expectedException \LogicException - * @expectedExceptionMessage Name must be a string or an instance of PhpParser\Node\Name + * @expectedExceptionMessage Name must be a string or an instance of Node\Name */ public function testInvalidName() { $this->createClassBuilder('Test') - ->extend(array('Foo')); + ->extend(['Foo']); } }