From 8c7543cc60e9df6a847982d0ffb791eee78f0298 Mon Sep 17 00:00:00 2001 From: George Steel Date: Mon, 25 Jul 2022 12:22:21 +0100 Subject: [PATCH] Bumps minimum version of doctrine annotations to `1.13.3` to solve test failures Doctrine Annotations now converts deprecations to exceptions ref: https://github.com/doctrine/annotations/pull/438 Signed-off-by: George Steel --- composer.json | 2 +- composer.lock | 21 ++++++++--------- test/Annotation/AbstractBuilderTestCase.php | 25 +++++++++++---------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index 0e23e5602..f3022f018 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require-dev": { "ext-intl": "*", - "doctrine/annotations": "^1.13.2", + "doctrine/annotations": "^1.13.3", "laminas/laminas-captcha": "^2.11.0", "laminas/laminas-coding-standard": "^2.3.0", "laminas/laminas-db": "^2.13.4", diff --git a/composer.lock b/composer.lock index 1d73edf1f..5426d3271 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "963c67ebd2e2fb4c8e185ddbc4ea14b4", + "content-hash": "4f01b05d2599142db421356c57fc6a32", "packages": [ { "name": "container-interop/container-interop", @@ -1312,16 +1312,16 @@ }, { "name": "doctrine/annotations", - "version": "1.13.2", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "reference": "648b0343343565c4a056bfc8392201385e8d89f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", + "reference": "648b0343343565c4a056bfc8392201385e8d89f0", "shasum": "" }, "require": { @@ -1333,9 +1333,10 @@ "require-dev": { "doctrine/cache": "^1.11 || ^2.0", "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", + "phpstan/phpstan": "^1.4.10 || ^1.8.0", "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "symfony/cache": "^4.4 || ^5.2", + "vimeo/psalm": "^4.10" }, "type": "library", "autoload": { @@ -1378,9 +1379,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" + "source": "https://github.com/doctrine/annotations/tree/1.13.3" }, - "time": "2021-08-05T19:00:23+00:00" + "time": "2022-07-02T10:48:51+00:00" }, { "name": "doctrine/instantiator", @@ -6188,5 +6189,5 @@ "platform-overrides": { "php": "7.4.99" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/test/Annotation/AbstractBuilderTestCase.php b/test/Annotation/AbstractBuilderTestCase.php index b4aeaab17..136d4eaf1 100644 --- a/test/Annotation/AbstractBuilderTestCase.php +++ b/test/Annotation/AbstractBuilderTestCase.php @@ -4,6 +4,7 @@ namespace LaminasTest\Form\Annotation; +use Doctrine\Common\Annotations\AnnotationException; use Generator; use Laminas\Form\Annotation; use Laminas\Form\Element; @@ -406,37 +407,37 @@ public function testInputFilterAnnotationAllowsComposition(): void public function testLegacyComposedObjectAnnotation(): void { - $this->expectDeprecation(); - $this->expectDeprecationMessageMatches('/Passing a single array .* is deprecated/'); + $this->expectException(AnnotationException::class); + $this->expectExceptionMessageMatches('/Passing a single array .* is deprecated/'); $entity = new TestAsset\Annotation\LegacyComposedObjectAnnotation(); $builder = $this->createBuilder(); - $form = $builder->createForm($entity); + $builder->createForm($entity); } public function testLegacyStyleFilterAnnotations(): void { - $this->expectDeprecation(); - $this->expectDeprecationMessageMatches('/Passing a single array .* is deprecated/'); + $this->expectException(AnnotationException::class); + $this->expectExceptionMessageMatches('/Passing a single array .* is deprecated/'); $entity = new TestAsset\Annotation\LegacyFilterAnnotation(); $builder = $this->createBuilder(); - $form = $builder->createForm($entity); + $builder->createForm($entity); } public function testLegacyStyleHydratorAnnotations(): void { - $this->expectDeprecation(); - $this->expectDeprecationMessageMatches('/Passing a single array .* is deprecated/'); + $this->expectException(AnnotationException::class); + $this->expectExceptionMessageMatches('/Passing a single array .* is deprecated/'); $entity = new TestAsset\Annotation\LegacyHydratorAnnotation(); $builder = $this->createBuilder(); - $form = $builder->createForm($entity); + $builder->createForm($entity); } public function testLegacyStyleValidatorAnnotations(): void { - $this->expectDeprecation(); - $this->expectDeprecationMessageMatches('/Passing a single array .* is deprecated/'); + $this->expectException(AnnotationException::class); + $this->expectExceptionMessageMatches('/Passing a single array .* is deprecated/'); $entity = new TestAsset\Annotation\LegacyValidatorAnnotation(); $builder = $this->createBuilder(); - $form = $builder->createForm($entity); + $builder->createForm($entity); } }