diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 5c9509b..3a7d545 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -147,11 +147,12 @@ class ConfigurationTest extends TestCase /** * @group legacy - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage You must not use both `nelmio_api_doc.areas` and `nelmio_api_doc.routes` config options. Please update your config to only use `nelmio_api_doc.areas`. */ public function testBothAreasAndRoutes() { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('You must not use both `nelmio_api_doc.areas` and `nelmio_api_doc.routes` config options. Please update your config to only use `nelmio_api_doc.areas`.'); + $processor = new Processor(); $config = $processor->processConfiguration(new Configuration(), [['areas' => [], 'routes' => []]]); } diff --git a/Tests/Describer/ApiPlatformDescriberTest.php b/Tests/Describer/ApiPlatformDescriberTest.php index 73b3c30..13fb1a5 100644 --- a/Tests/Describer/ApiPlatformDescriberTest.php +++ b/Tests/Describer/ApiPlatformDescriberTest.php @@ -45,7 +45,7 @@ class ApiPlatformDescriberTest extends AbstractDescriberTest $this->assertEquals($expectedApi->toJson(), $this->getOpenApiDoc()->toJson()); } - protected function setUp() + protected function setUp(): void { $this->documentation = new Documentation(new ResourceNameCollection(['dummy' => 'dummy'])); diff --git a/Tests/Describer/RouteDescriberTest.php b/Tests/Describer/RouteDescriberTest.php index dff1ba4..1d0c9ca 100644 --- a/Tests/Describer/RouteDescriberTest.php +++ b/Tests/Describer/RouteDescriberTest.php @@ -35,7 +35,7 @@ class RouteDescriberTest extends AbstractDescriberTest $this->assertEquals((new OpenApi([]))->toJson(), $this->getOpenApiDoc()->toJson()); } - protected function setUp() + protected function setUp(): void { $this->routeDescriber = $this->createMock(RouteDescriberInterface::class); $this->routes = new RouteCollection(); diff --git a/Tests/Functional/BazingaFunctionalTest.php b/Tests/Functional/BazingaFunctionalTest.php index 918be18..9ed1767 100644 --- a/Tests/Functional/BazingaFunctionalTest.php +++ b/Tests/Functional/BazingaFunctionalTest.php @@ -15,7 +15,7 @@ use Hateoas\Configuration\Embedded; class BazingaFunctionalTest extends WebTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/Tests/Functional/FOSRestTest.php b/Tests/Functional/FOSRestTest.php index 2a04b2c..4cf601b 100644 --- a/Tests/Functional/FOSRestTest.php +++ b/Tests/Functional/FOSRestTest.php @@ -16,7 +16,7 @@ use OpenApi\Annotations as OA; class FOSRestTest extends WebTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php index 8e3c9ae..8a4c8d7 100644 --- a/Tests/Functional/FunctionalTest.php +++ b/Tests/Functional/FunctionalTest.php @@ -17,7 +17,7 @@ use Symfony\Component\Serializer\Annotation\SerializedName; class FunctionalTest extends WebTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/Tests/Functional/JMSFunctionalTest.php b/Tests/Functional/JMSFunctionalTest.php index 3ad5704..fed0b98 100644 --- a/Tests/Functional/JMSFunctionalTest.php +++ b/Tests/Functional/JMSFunctionalTest.php @@ -13,7 +13,7 @@ namespace Nelmio\ApiDocBundle\Tests\Functional; class JMSFunctionalTest extends WebTestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/Tests/Functional/SwaggerUiTest.php b/Tests/Functional/SwaggerUiTest.php index 894af56..ea4f7f7 100644 --- a/Tests/Functional/SwaggerUiTest.php +++ b/Tests/Functional/SwaggerUiTest.php @@ -20,7 +20,7 @@ class SwaggerUiTest extends WebTestCase */ private $client; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/Tests/Routing/FilteredRouteCollectionBuilderTest.php b/Tests/Routing/FilteredRouteCollectionBuilderTest.php index f8d01c1..c2a152b 100644 --- a/Tests/Routing/FilteredRouteCollectionBuilderTest.php +++ b/Tests/Routing/FilteredRouteCollectionBuilderTest.php @@ -19,6 +19,7 @@ use Nelmio\ApiDocBundle\Util\ControllerReflector; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser; use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection; @@ -84,12 +85,12 @@ class FilteredRouteCollectionBuilderTest extends TestCase } /** - * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidArgumentException - * * @dataProvider getInvalidOptions */ public function testFilterWithInvalidOption(array $options) { + $this->expectException(InvalidArgumentException::class); + new FilteredRouteCollectionBuilder( new AnnotationReader(), $this->createControllerReflector(), diff --git a/Tests/SwaggerPhp/UtilTest.php b/Tests/SwaggerPhp/UtilTest.php index ec88b5c..2b3bfc8 100644 --- a/Tests/SwaggerPhp/UtilTest.php +++ b/Tests/SwaggerPhp/UtilTest.php @@ -46,7 +46,7 @@ class UtilTest extends TestCase /** @var OA\OpenApi */ public $rootAnnotation; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/phpunit b/phpunit index 2934e5b..79af86a 100755 --- a/phpunit +++ b/phpunit @@ -5,5 +5,5 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) { exit(1); } putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit'); -putenv('SYMFONY_PHPUNIT_VERSION=6.5'); +putenv('SYMFONY_PHPUNIT_VERSION=7.5'); require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit'; diff --git a/phpunit.bat b/phpunit.bat new file mode 100644 index 0000000..9c147f4 --- /dev/null +++ b/phpunit.bat @@ -0,0 +1,2 @@ +@ECHO OFF +php "%~dp0phpunit" %* \ No newline at end of file