MagicConstTest.php 794 B

1234567891011121314151617181920212223242526
  1. <?php declare(strict_types=1);
  2. namespace PhpParser\Node\Scalar;
  3. class MagicConstTest extends \PHPUnit\Framework\TestCase
  4. {
  5. /**
  6. * @dataProvider provideTestGetName
  7. */
  8. public function testGetName(MagicConst $magicConst, $name) {
  9. $this->assertSame($name, $magicConst->getName());
  10. }
  11. public function provideTestGetName() {
  12. return [
  13. [new MagicConst\Class_, '__CLASS__'],
  14. [new MagicConst\Dir, '__DIR__'],
  15. [new MagicConst\File, '__FILE__'],
  16. [new MagicConst\Function_, '__FUNCTION__'],
  17. [new MagicConst\Line, '__LINE__'],
  18. [new MagicConst\Method, '__METHOD__'],
  19. [new MagicConst\Namespace_, '__NAMESPACE__'],
  20. [new MagicConst\Trait_, '__TRAIT__'],
  21. ];
  22. }
  23. }