annotate vendor/nikic/php-parser/test/PhpParser/Node/IdentifierTest.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 |
|
| children |
129ea1e6d783 |
| rev |
line source |
|
Chris@13
|
1 <?php declare(strict_types=1);
|
|
Chris@13
|
2
|
|
Chris@13
|
3 namespace PhpParser\Node;
|
|
Chris@13
|
4
|
|
Chris@13
|
5 use PHPUnit\Framework\TestCase;
|
|
Chris@13
|
6
|
|
Chris@13
|
7 class IdentifierTest extends TestCase
|
|
Chris@13
|
8 {
|
|
Chris@13
|
9 public function testToString() {
|
|
Chris@13
|
10 $identifier = new Identifier('Foo');
|
|
Chris@13
|
11
|
|
Chris@13
|
12 $this->assertSame('Foo', (string) $identifier);
|
|
Chris@13
|
13 $this->assertSame('Foo', $identifier->toString());
|
|
Chris@13
|
14 $this->assertSame('foo', $identifier->toLowerString());
|
|
Chris@13
|
15 }
|
|
Chris@13
|
16
|
|
Chris@13
|
17 /** @dataProvider provideTestIsSpecialClassName */
|
|
Chris@13
|
18 public function testIsSpecialClassName($identifier, $expected) {
|
|
Chris@13
|
19 $identifier = new Identifier($identifier);
|
|
Chris@13
|
20 $this->assertSame($expected, $identifier->isSpecialClassName());
|
|
Chris@13
|
21 }
|
|
Chris@13
|
22
|
|
Chris@13
|
23 public function provideTestIsSpecialClassName() {
|
|
Chris@13
|
24 return [
|
|
Chris@13
|
25 ['self', true],
|
|
Chris@13
|
26 ['PARENT', true],
|
|
Chris@13
|
27 ['Static', true],
|
|
Chris@13
|
28 ['other', false],
|
|
Chris@13
|
29 ];
|
|
Chris@13
|
30 }
|
|
Chris@13
|
31 }
|