annotate vendor/theseer/tokenizer/tests/NamespaceUriTest.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 1fec387a4317
children
rev   line source
Chris@14 1 <?php declare(strict_types = 1);
Chris@14 2 namespace TheSeer\Tokenizer;
Chris@14 3
Chris@14 4 use PHPUnit\Framework\TestCase;
Chris@14 5
Chris@14 6 /**
Chris@14 7 * @covers \TheSeer\Tokenizer\NamespaceUri
Chris@14 8 */
Chris@14 9 class NamespaceUriTest extends TestCase {
Chris@14 10
Chris@14 11 public function testCanBeConstructedWithValidNamespace() {
Chris@14 12 $this->assertInstanceOf(
Chris@14 13 NamespaceUri::class,
Chris@14 14 new NamespaceUri('a:b')
Chris@14 15 );
Chris@14 16 }
Chris@14 17
Chris@14 18 public function testInvalidNamespaceThrowsException() {
Chris@14 19 $this->expectException(NamespaceUriException::class);
Chris@14 20 new NamespaceUri('invalid-no-colon');
Chris@14 21 }
Chris@14 22
Chris@14 23 public function testStringRepresentationCanBeRetrieved() {
Chris@14 24 $this->assertEquals(
Chris@14 25 'a:b',
Chris@14 26 (new NamespaceUri('a:b'))->asString()
Chris@14 27 );
Chris@14 28 }
Chris@14 29 }