IdentifierTest.php 850 B

1234567891011121314151617181920212223242526272829
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node;
  3. class IdentifierTest extends \PHPUnit\Framework\TestCase
  4. {
  5. public function testToString() {
  6. $identifier = new Identifier('Foo');
  7. $this->assertSame('Foo', (string) $identifier);
  8. $this->assertSame('Foo', $identifier->toString());
  9. $this->assertSame('foo', $identifier->toLowerString());
  10. }
  11. /** @dataProvider provideTestIsSpecialClassName */
  12. public function testIsSpecialClassName($identifier, $expected) {
  13. $identifier = new Identifier($identifier);
  14. $this->assertSame($expected, $identifier->isSpecialClassName());
  15. }
  16. public function provideTestIsSpecialClassName() {
  17. return [
  18. ['self', true],
  19. ['PARENT', true],
  20. ['Static', true],
  21. ['other', false],
  22. ];
  23. }
  24. }