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