comparison vendor/nikic/php-parser/test/PhpParser/Node/Stmt/ClassConstTest.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
12:7a779792577d 13:5fb285c0d0e3
1 <?php 1 <?php declare(strict_types=1);
2 2
3 namespace PhpParser\Node\Stmt; 3 namespace PhpParser\Node\Stmt;
4 4
5 class ClassConstTest extends \PHPUnit_Framework_TestCase 5 use PHPUnit\Framework\TestCase;
6
7 class ClassConstTest extends TestCase
6 { 8 {
7 /** 9 /**
8 * @dataProvider provideModifiers 10 * @dataProvider provideModifiers
9 */ 11 */
10 public function testModifiers($modifier) { 12 public function testModifiers($modifier) {
11 $node = new ClassConst( 13 $node = new ClassConst(
12 array(), // invalid 14 [], // invalid
13 constant('PhpParser\Node\Stmt\Class_::MODIFIER_' . strtoupper($modifier)) 15 constant('PhpParser\Node\Stmt\Class_::MODIFIER_' . strtoupper($modifier))
14 ); 16 );
15 17
16 $this->assertTrue($node->{'is' . $modifier}()); 18 $this->assertTrue($node->{'is' . $modifier}());
17 } 19 }
18 20
19 public function testNoModifiers() { 21 public function testNoModifiers() {
20 $node = new ClassConst(array(), 0); 22 $node = new ClassConst([], 0);
21 23
22 $this->assertTrue($node->isPublic()); 24 $this->assertTrue($node->isPublic());
23 $this->assertFalse($node->isProtected()); 25 $this->assertFalse($node->isProtected());
24 $this->assertFalse($node->isPrivate()); 26 $this->assertFalse($node->isPrivate());
25 $this->assertFalse($node->isStatic());
26 } 27 }
27 28
28 public function provideModifiers() { 29 public function provideModifiers() {
29 return array( 30 return [
30 array('public'), 31 ['public'],
31 array('protected'), 32 ['protected'],
32 array('private'), 33 ['private'],
33 ); 34 ];
34 } 35 }
35 } 36 }