From 0586672b946ebd16661ced360c5eb4059b6733f9 Mon Sep 17 00:00:00 2001 From: Ivan Herak Date: Fri, 15 Nov 2019 11:16:54 +0100 Subject: [PATCH] NGSTACK-342 update tests --- composer.json | 7 +++---- phpunit.xml.dist => phpunit.xml | 2 +- .../RemoteMediaStorage/Gateway/LegacyStorageTest.php | 6 ++++++ tests/DependencyInjection/Compiler/XslRegisterPassTest.php | 3 +++ .../Cloudinary/Gateway/CloudinaryApiGatewayTest.php | 5 ++--- 5 files changed, 15 insertions(+), 8 deletions(-) rename phpunit.xml.dist => phpunit.xml (93%) diff --git a/composer.json b/composer.json index bc0eb39a..698af7dc 100644 --- a/composer.json +++ b/composer.json @@ -33,13 +33,12 @@ "cloudinary/cloudinary_php": "^1.0" }, "require-dev": { - "ezsystems/legacy-bridge": "^1.3.0", + "ezsystems/legacy-bridge": "^2.0", "netgen/open-graph-bundle": "^1.0", "netgen/admin-ui-bundle": "^2.0", - "matthiasnoback/symfony-config-test": "^2.0", - "matthiasnoback/symfony-dependency-injection-test": "^1.0", + "matthiasnoback/symfony-dependency-injection-test": "^3.0", "mikey179/vfsstream": "^1.0", - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "^7.0", "friendsofphp/php-cs-fixer": "^2.0" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml similarity index 93% rename from phpunit.xml.dist rename to phpunit.xml index d2ac7a93..542cce32 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml @@ -34,7 +34,7 @@ - + diff --git a/tests/Core/FieldType/RemoteMedia/RemoteMediaStorage/Gateway/LegacyStorageTest.php b/tests/Core/FieldType/RemoteMedia/RemoteMediaStorage/Gateway/LegacyStorageTest.php index a178e9a6..10b68c62 100644 --- a/tests/Core/FieldType/RemoteMedia/RemoteMediaStorage/Gateway/LegacyStorageTest.php +++ b/tests/Core/FieldType/RemoteMedia/RemoteMediaStorage/Gateway/LegacyStorageTest.php @@ -55,6 +55,9 @@ public function testConnectionHandling() $handler = $this->getMockForAbstractClass(DatabaseHandler::class); $this->storage->setConnection($handler); + + // Avoid detecting risky tests + $this->assertTrue(true); } /** @@ -66,6 +69,9 @@ public function testConnectionHandlingWithInvalidConnection() $handler = new \stdClass(); $this->storage->setConnection($handler); + + // Avoid detecting risky tests + $this->assertTrue(true); } public function testStoreFieldDataInsertNew() diff --git a/tests/DependencyInjection/Compiler/XslRegisterPassTest.php b/tests/DependencyInjection/Compiler/XslRegisterPassTest.php index 8174dc93..365a5daa 100644 --- a/tests/DependencyInjection/Compiler/XslRegisterPassTest.php +++ b/tests/DependencyInjection/Compiler/XslRegisterPassTest.php @@ -55,6 +55,9 @@ public function testCompilerPassWithoutExistingXslConfig() $this->setParameter('ezpublish.siteaccess.list', $siteaccessList); $this->compile(); + + // Avoid detecting risky tests + $this->assertTrue(true); } protected function registerCompilerPass(ContainerBuilder $container) diff --git a/tests/RemoteMedia/Provider/Cloudinary/Gateway/CloudinaryApiGatewayTest.php b/tests/RemoteMedia/Provider/Cloudinary/Gateway/CloudinaryApiGatewayTest.php index 5cbc0df2..dd8272b8 100644 --- a/tests/RemoteMedia/Provider/Cloudinary/Gateway/CloudinaryApiGatewayTest.php +++ b/tests/RemoteMedia/Provider/Cloudinary/Gateway/CloudinaryApiGatewayTest.php @@ -11,8 +11,7 @@ use Netgen\Bundle\RemoteMediaBundle\RemoteMedia\Provider\Cloudinary\Gateway\CloudinaryApiGateway; use Netgen\Bundle\RemoteMediaBundle\RemoteMedia\Provider\Cloudinary\Search\Query; use PHPUnit\Framework\TestCase; -use PHPUnit_Framework_Constraint_IsAnything; -use PHPUnit_Framework_Constraint_Or; +use PHPUnit\Framework\Constraint\LogicalOr; class CloudinaryApiGatewayTest extends TestCase { @@ -58,7 +57,7 @@ public function setUp() private function setUpSearch() { - $constraints = new PHPUnit_Framework_Constraint_Or(); + $constraints = new LogicalOr(); $constraints->setConstraints([ 'expression', 'max_results', 'with_field' ]);