4 * This file is part of Psy Shell.
6 * (c) 2012-2017 Justin Hileman
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Psy\Test\Reflection;
14 use Psy\Reflection\ReflectionConstant;
16 class ReflectionConstantTest extends \PHPUnit_Framework_TestCase
18 const CONSTANT_ONE = 'one';
20 public function testConstruction()
22 $refl = new ReflectionConstant($this, 'CONSTANT_ONE');
23 $class = $refl->getDeclaringClass();
25 $this->assertTrue($class instanceof \ReflectionClass);
26 $this->assertEquals('Psy\Test\Reflection\ReflectionConstantTest', $class->getName());
27 $this->assertEquals('CONSTANT_ONE', $refl->getName());
28 $this->assertEquals('CONSTANT_ONE', (string) $refl);
29 $this->assertEquals('one', $refl->getValue());
30 $this->assertEquals(null, $refl->getFileName());
31 $this->assertFalse($refl->getDocComment());
35 * @expectedException \InvalidArgumentException
37 public function testUnknownConstantThrowsException()
39 new ReflectionConstant($this, 'UNKNOWN_CONSTANT');
43 * @expectedException \RuntimeException
44 * @dataProvider notYetImplemented
46 public function testNotYetImplemented($method)
48 $refl = new ReflectionConstant($this, 'CONSTANT_ONE');
52 public function notYetImplemented()
55 array('getStartLine'),