1<?php declare(strict_types=1); 2 3namespace PhpParser\Node; 4 5use PhpParser\Modifiers; 6 7class PropertyHookTest extends \PHPUnit\Framework\TestCase { 8 /** 9 * @dataProvider provideModifiers 10 */ 11 public function testModifiers($modifier): void { 12 $node = new PropertyHook( 13 'get', 14 null, 15 [ 16 'flags' => constant(Modifiers::class . '::' . strtoupper($modifier)), 17 ] 18 ); 19 20 $this->assertTrue($node->{'is' . $modifier}()); 21 } 22 23 public function testNoModifiers(): void { 24 $node = new PropertyHook('get', null); 25 26 $this->assertFalse($node->isFinal()); 27 } 28 29 public static function provideModifiers() { 30 return [ 31 ['final'], 32 ]; 33 } 34} 35