1<?php declare(strict_types=1); 2 3namespace PhpParser; 4 5use InvalidArgumentException; 6use PHPUnit\Framework\TestCase; 7 8class ModifiersTest extends TestCase { 9 public function testToString() { 10 $this->assertSame('public', Modifiers::toString(Modifiers::PUBLIC)); 11 } 12 13 public function testToStringInvalid() { 14 $this->expectException(InvalidArgumentException::class); 15 $this->expectExceptionMessage('Unknown modifier 3'); 16 Modifiers::toString(Modifiers::PUBLIC | Modifiers::PROTECTED); 17 } 18} 19