From 34c3e782ede03f3b228ca7316ac8e2d3b1f6a327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Poirier=20Th=C3=A9or=C3=AAt?= Date: Mon, 11 May 2020 12:52:35 -0400 Subject: [PATCH] Remove phpunit 7 support Temporary fix of deprecated assertFileNotExist so we do not have warning --- composer.json | 2 +- tests/SerializerBuilderTest.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 62282bf7d..919ed1272 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "symfony/form": "^3.0|^4.0|^5.0", "symfony/filesystem": "^3.0|^4.0|^5.0", "symfony/expression-language": "^3.0|^4.0|^5.0", - "phpunit/phpunit": "^7.5||^8.0||^9.0", + "phpunit/phpunit": "^8.0||^9.0", "doctrine/coding-standard": "^5.0" }, "conflict": { diff --git a/tests/SerializerBuilderTest.php b/tests/SerializerBuilderTest.php index e40d7a411..4f5eb82e6 100644 --- a/tests/SerializerBuilderTest.php +++ b/tests/SerializerBuilderTest.php @@ -14,6 +14,8 @@ use JMS\Serializer\Tests\Fixtures\PersonSecretWithVariables; use JMS\Serializer\Type\ParserInterface; use JMS\Serializer\Visitor\Factory\JsonSerializationVisitorFactory; +use PHPUnit\Framework\Constraint\FileExists; +use PHPUnit\Framework\Constraint\LogicalNot; use PHPUnit\Framework\TestCase; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; @@ -41,7 +43,8 @@ public function testBuildWithoutAnythingElse() public function testWithCache() { - self::assertFileNotExists($this->tmpDir); + // @todo change to static::assertFileNotExists when support for PHPUnit 8 and PHP 7.2 is dropped + static::assertThat($this->tmpDir, new LogicalNot(new FileExists())); self::assertSame($this->builder, $this->builder->setCacheDir($this->tmpDir)); $serializer = $this->builder->build();