From ad1e63e15c2f33d1241724a3c0c1361374785ca8 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 31 Oct 2022 16:20:50 +0100 Subject: [PATCH] Fix tests --- tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php | 2 +- tests/Barryvdh/Reflection/DocBlock/TagTest.php | 6 +++--- tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php | 2 +- tests/Barryvdh/Reflection/DocBlockTest.php | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php b/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php index a277595..4cec563 100644 --- a/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php @@ -108,7 +108,7 @@ LONGDESC; $parsedDescription = $parsedContents[1]->getParsedDescription(); $this->assertCount(3, $parsedDescription); - $this->assertSame("inline tag with\n", $parsedDescription[0]); + $this->assertSame("inline tag with", trim($parsedDescription[0])); $this->assertInstanceOf( __NAMESPACE__ . '\Tag\LinkTag', $parsedDescription[1] diff --git a/tests/Barryvdh/Reflection/DocBlock/TagTest.php b/tests/Barryvdh/Reflection/DocBlock/TagTest.php index 300cc74..1dfe508 100644 --- a/tests/Barryvdh/Reflection/DocBlock/TagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/TagTest.php @@ -28,12 +28,12 @@ class TagTest extends TestCase { /** - * @expectedException \InvalidArgumentException - * + * * @return void */ public function testInvalidTagLine() { + $this->expectException(\InvalidArgumentException::class); Tag::createInstance('Invalid tag line'); } @@ -77,7 +77,7 @@ class TagTest extends TestCase */ public function testTagHandlerCorrectRegistration() { - if (0 == ini_get('allow_url_include')) { + if (!ini_get('allow_url_include')) { $this->markTestSkipped('"data" URIs for includes are required.'); } $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; diff --git a/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php index 9a39359..b1b456f 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php @@ -146,12 +146,12 @@ class CollectionTest extends TestCase /** * @covers Barryvdh\Reflection\DocBlock\Type\Collection::add - * @expectedException InvalidArgumentException * * @return void */ public function testAddWithInvalidArgument() { + $this->expectException(\InvalidArgumentException::class); $collection = new Collection(); $collection->add(array()); } diff --git a/tests/Barryvdh/Reflection/DocBlockTest.php b/tests/Barryvdh/Reflection/DocBlockTest.php index 2ee2f35..ab197a6 100644 --- a/tests/Barryvdh/Reflection/DocBlockTest.php +++ b/tests/Barryvdh/Reflection/DocBlockTest.php @@ -166,12 +166,12 @@ DOCBLOCK; } /** - * @expectedException \InvalidArgumentException - * + * * @return void */ public function testExceptionOnInvalidObject() { + $this->expectException(\InvalidArgumentException::class); new DocBlock($this); } @@ -204,8 +204,9 @@ DOCBLOCK; */ public function testInvalidTagBlock() { - if (0 == ini_get('allow_url_include')) { + if (!ini_get('allow_url_include')) { $this->markTestSkipped('"data" URIs for includes are required.'); + return; } include 'data:text/plain;base64,'. base64_encode(