Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/test/PhpParser/Node/IdentifierTest.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 5fb285c0d0e3 |
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 } |