From a65b7c4074ec96a9c1dff83e34eff019c8958fc6 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Wed, 31 May 2017 19:36:17 +0200 Subject: [PATCH] Use phpunit 6 --- Tests/Describer/AbstractDescriberTest.php | 3 ++- Tests/Model/ModelRegistryTest.php | 6 ++++-- composer.json | 1 - phpunit | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Tests/Describer/AbstractDescriberTest.php b/Tests/Describer/AbstractDescriberTest.php index 9402a9f..b1cca2d 100644 --- a/Tests/Describer/AbstractDescriberTest.php +++ b/Tests/Describer/AbstractDescriberTest.php @@ -12,8 +12,9 @@ namespace Nelmio\ApiDocBundle\Tests\Describer; use EXSyst\Component\Swagger\Swagger; +use PHPUnit\Framework\TestCase; -abstract class AbstractDescriberTest extends \PHPUnit_Framework_TestCase +abstract class AbstractDescriberTest extends TestCase { protected $describer; diff --git a/Tests/Model/ModelRegistryTest.php b/Tests/Model/ModelRegistryTest.php index 8ad5a3a..e041db9 100644 --- a/Tests/Model/ModelRegistryTest.php +++ b/Tests/Model/ModelRegistryTest.php @@ -13,18 +13,20 @@ namespace Nelmio\ApiDocBundle\Tests\Model; use EXSyst\Component\Swagger\Schema; use EXSyst\Component\Swagger\Swagger; +use PHPUnit\Framework\TestCase; use Nelmio\ApiDocBundle\Model\Model; use Nelmio\ApiDocBundle\Model\ModelRegistry; use Symfony\Component\PropertyInfo\Type; -class ModelRegistryTest extends \PHPUnit_Framework_TestCase +class ModelRegistryTest extends TestCase { /** * @dataProvider unsupportedTypesProvider */ public function testUnsupportedTypeException(Type $type, string $stringType) { - $this->setExpectedException('\LogicException', sprintf('Schema of type "%s" can\'t be generated, no describer supports it.', $stringType)); + $this->expectException('\LogicException'); + $this->expectExceptionMessage(sprintf('Schema of type "%s" can\'t be generated, no describer supports it.', $stringType)); $registry = new ModelRegistry([], new Swagger()); $registry->register(new Model($type)); diff --git a/composer.json b/composer.json index 059bfdd..7ea0101 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,6 @@ "symfony/cache": "^3.1", "symfony/phpunit-bridge": "^3.2", "sensio/framework-extra-bundle": "^3.0", - "phpunit/phpunit": "^5.4", "doctrine/annotations": "^1.2", "phpdocumentor/reflection-docblock": "^3.1", diff --git a/phpunit b/phpunit index ffa70d2..e26030b 100755 --- a/phpunit +++ b/phpunit @@ -5,4 +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.0'); require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';