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