From 72df918400f381cbe74c18fa9b8057588cc6c7c0 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 31 Oct 2022 16:05:08 +0100 Subject: [PATCH 1/4] Create run-tests.yml --- .github/workflows/run-tests.yml | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..b272bec --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,43 @@ +name: Unit Tests + +on: + push: + branches: + - master + pull_request: + branches: + - "*" + schedule: + - cron: '0 0 * * *' + +jobs: + php-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + COMPOSER_NO_INTERACTION: 1 + + strategy: + matrix: + php: [8.1, 8.0, 7.4, 7.3, 7.2] + dependency-version: [prefer-lowest, prefer-stable] + + name: P${{ matrix.php }} - ${{ matrix.dependency-version }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer:v2 + + - name: Install dependencies + run: | + composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress + + - name: Execute Unit Tests + run: vendor/bin/phpunit From fe49c3d9ee9d4f7a7863a17a34a225f6a85efd0a Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 31 Oct 2022 16:13:07 +0100 Subject: [PATCH 2/4] Update tests --- .travis.yml | 26 ------------------- composer.json | 2 +- .../Reflection/DocBlock/DescriptionTest.php | 4 ++- .../Reflection/DocBlock/Tag/CoversTagTest.php | 4 ++- .../DocBlock/Tag/DeprecatedTagTest.php | 4 ++- .../DocBlock/Tag/ExampleTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/LinkTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/MethodTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/ParamTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/ReturnTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/SeeTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/SinceTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/SourceTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/ThrowsTagTest.php | 4 ++- .../Reflection/DocBlock/Tag/UsesTagTest.php | 5 +++- .../Reflection/DocBlock/Tag/VarTagTest.php | 5 +++- .../DocBlock/Tag/VersionTagTest.php | 4 ++- .../Barryvdh/Reflection/DocBlock/TagTest.php | 3 ++- .../DocBlock/Type/CollectionTest.php | 3 ++- tests/Barryvdh/Reflection/DocBlockTest.php | 3 ++- 20 files changed, 54 insertions(+), 45 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4963410..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - dist: xenial - - php: 7.0 - dist: xenial - - php: 7.1 - dist: bionic - - php: 7.2 - dist: bionic - - php: 7.3 - dist: bionic - - php: 7.4 - dist: bionic - -before_script: travis_retry composer install - -script: vendor/bin/phpunit diff --git a/composer.json b/composer.json index ef13956..1f61ca1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "psr-0": {"Barryvdh": ["src/"]} }, "require-dev": { - "phpunit/phpunit": "~4.0,<4.5" + "phpunit/phpunit": "^8.5.14|^9" }, "suggest": { "dflydev/markdown": "~1.0", diff --git a/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php b/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php index dbc47a5..a277595 100644 --- a/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/DescriptionTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Description * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class DescriptionTest extends \PHPUnit_Framework_TestCase +class DescriptionTest extends TestCase { public function testConstruct() { diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/CoversTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/CoversTagTest.php index 59d5e87..7f33c1e 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/CoversTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/CoversTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\CoversTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class CoversTagTest extends \PHPUnit_Framework_TestCase +class CoversTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\CoversTag can create diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTagTest.php index aaaaf33..aae720f 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/DeprecatedTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class DeprecatedTagTest extends \PHPUnit_Framework_TestCase +class DeprecatedTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/ExampleTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ExampleTagTest.php index 16024f1..c39685e 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/ExampleTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/ExampleTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\ExampleTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class ExampleTagTest extends \PHPUnit_Framework_TestCase +class ExampleTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\SourceTag can diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/LinkTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/LinkTagTest.php index bd76a21..ae8107b 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/LinkTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/LinkTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\LinkTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class LinkTagTest extends \PHPUnit_Framework_TestCase +class LinkTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php index 5a2cb6e..32f7ea4 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/MethodTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\MethodTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class MethodTagTest extends \PHPUnit_Framework_TestCase +class MethodTagTest extends TestCase { /** * @param string $signature The signature to test. diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php index ce4a4e5..3fd9e61 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/ParamTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\ParamTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class ParamTagTest extends \PHPUnit_Framework_TestCase +class ParamTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\ParamTag can diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/ReturnTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ReturnTagTest.php index 92fb58d..a86b65b 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/ReturnTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/ReturnTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\ReturnTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class ReturnTagTest extends \PHPUnit_Framework_TestCase +class ReturnTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\ReturnTag can diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/SeeTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/SeeTagTest.php index 22f323c..b5f3399 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/SeeTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/SeeTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\SeeTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class SeeTagTest extends \PHPUnit_Framework_TestCase +class SeeTagTest extends TestCase { /** * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/SinceTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/SinceTagTest.php index d910328..3e7be67 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/SinceTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/SinceTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\SinceTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class SinceTagTest extends \PHPUnit_Framework_TestCase +class SinceTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/SourceTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/SourceTagTest.php index fbe6f22..401c2d4 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/SourceTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/SourceTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\SourceTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class SourceTagTest extends \PHPUnit_Framework_TestCase +class SourceTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\SourceTag can diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/ThrowsTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/ThrowsTagTest.php index 4ae3fa3..6888cee 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/ThrowsTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/ThrowsTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\ThrowsTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class ThrowsTagTest extends \PHPUnit_Framework_TestCase +class ThrowsTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\ThrowsTag can diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/UsesTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/UsesTagTest.php index ad83338..c56f177 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/UsesTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/UsesTagTest.php @@ -12,6 +12,9 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\Test; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\UsesTag * @@ -20,7 +23,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class UsesTagTest extends \PHPUnit_Framework_TestCase +class UsesTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\UsesTag can create diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/VarTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/VarTagTest.php index f192482..def1f68 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/VarTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/VarTagTest.php @@ -12,6 +12,9 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\Test; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\VarTag * @@ -20,7 +23,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class VarTagTest extends \PHPUnit_Framework_TestCase +class VarTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\VarTag can diff --git a/tests/Barryvdh/Reflection/DocBlock/Tag/VersionTagTest.php b/tests/Barryvdh/Reflection/DocBlock/Tag/VersionTagTest.php index e8c853a..ddf0f1a 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Tag/VersionTagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Tag/VersionTagTest.php @@ -12,6 +12,8 @@ namespace Barryvdh\Reflection\DocBlock\Tag; +use PHPUnit\Framework\TestCase; + /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\VersionTag * @@ -20,7 +22,7 @@ namespace Barryvdh\Reflection\DocBlock\Tag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class VersionTagTest extends \PHPUnit_Framework_TestCase +class VersionTagTest extends TestCase { /** * Test that the \Barryvdh\Reflection\DocBlock\Tag\LinkTag can create diff --git a/tests/Barryvdh/Reflection/DocBlock/TagTest.php b/tests/Barryvdh/Reflection/DocBlock/TagTest.php index a7da285..300cc74 100644 --- a/tests/Barryvdh/Reflection/DocBlock/TagTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/TagTest.php @@ -14,6 +14,7 @@ namespace Barryvdh\Reflection\DocBlock; use Barryvdh\Reflection\DocBlock; use Barryvdh\Reflection\DocBlock\Context; +use PHPUnit\Framework\TestCase; /** * Test class for \Barryvdh\Reflection\DocBlock\Tag\VarTag @@ -23,7 +24,7 @@ use Barryvdh\Reflection\DocBlock\Context; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class TagTest extends \PHPUnit_Framework_TestCase +class TagTest extends TestCase { /** diff --git a/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php index f4df904..9a39359 100644 --- a/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php +++ b/tests/Barryvdh/Reflection/DocBlock/Type/CollectionTest.php @@ -13,6 +13,7 @@ namespace Barryvdh\Reflection\DocBlock\Type; use Barryvdh\Reflection\DocBlock\Context; +use PHPUnit\Framework\TestCase; /** * Test class for \Barryvdh\Reflection\DocBlock\Type\Collection @@ -24,7 +25,7 @@ use Barryvdh\Reflection\DocBlock\Context; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class CollectionTest extends \PHPUnit_Framework_TestCase +class CollectionTest extends TestCase { /** * @covers Barryvdh\Reflection\DocBlock\Type\Collection::__construct diff --git a/tests/Barryvdh/Reflection/DocBlockTest.php b/tests/Barryvdh/Reflection/DocBlockTest.php index fb73f59..2ee2f35 100644 --- a/tests/Barryvdh/Reflection/DocBlockTest.php +++ b/tests/Barryvdh/Reflection/DocBlockTest.php @@ -15,6 +15,7 @@ namespace Barryvdh\Reflection; use Barryvdh\Reflection\DocBlock\Context; use Barryvdh\Reflection\DocBlock\Location; use Barryvdh\Reflection\DocBlock\Tag\ReturnTag; +use PHPUnit\Framework\TestCase; /** * Test class for Barryvdh\Reflection\DocBlock @@ -24,7 +25,7 @@ use Barryvdh\Reflection\DocBlock\Tag\ReturnTag; * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ -class DocBlockTest extends \PHPUnit_Framework_TestCase +class DocBlockTest extends TestCase { /** * @covers \Barryvdh\Reflection\DocBlock From 6eafab0ff39998bc4191a286f57ad0f355a85b09 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 31 Oct 2022 16:13:13 +0100 Subject: [PATCH 3/4] Revert "Check namespace + class to see if it exists" This reverts commit 7f729dc9a7103a6a8b22ac7efe10ccd65edbdf91. --- src/Barryvdh/Reflection/DocBlock/Type/Collection.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Barryvdh/Reflection/DocBlock/Type/Collection.php b/src/Barryvdh/Reflection/DocBlock/Type/Collection.php index ef43406..82d64fa 100644 --- a/src/Barryvdh/Reflection/DocBlock/Type/Collection.php +++ b/src/Barryvdh/Reflection/DocBlock/Type/Collection.php @@ -210,11 +210,7 @@ class Collection extends \ArrayObject if ('' !== $namespace) { $namespace .= self::OPERATOR_NAMESPACE; } - $with_name_space = self::OPERATOR_NAMESPACE . $namespace . $type; - if($this->shouldBeAbsolute($with_name_space)){ - return $with_name_space; - } - return $type; + return self::OPERATOR_NAMESPACE . $namespace . $type; } if (strpos($type_parts[0], '::')) { From ad1e63e15c2f33d1241724a3c0c1361374785ca8 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 31 Oct 2022 16:20:50 +0100 Subject: [PATCH 4/4] 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(