From d07393ba226070d643eef13bb7db896499548bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Fri, 2 Aug 2019 13:48:30 +0200 Subject: [PATCH] Bump PHPUnit to 8.3 --- .gitignore | 1 + composer.json | 2 +- .../EnhancedSelectionStorageTest.php | 2 +- .../CriterionHandler/EnhancedSelectionTest.php | 12 +++++------- .../Form/FieldTypeHandler/EnhancedSelectionTest.php | 4 ++-- .../Twig/NetgenEnhancedSelectionRuntimeTest.php | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index b2ca97e..fe3a642 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ composer.phar composer.lock phpunit.phar .php_cs.cache +.phpunit.result.cache diff --git a/composer.json b/composer.json index d6feca1..55a2d3d 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "twig/twig": "^2.4.4" }, "require-dev": { - "phpunit/phpunit": "^8.2", + "phpunit/phpunit": "^8.3", "netgen/ez-forms-bundle": "^3.0", "friendsofphp/php-cs-fixer": "^2.15.1" }, diff --git a/tests/Core/FieldType/EnhancedSelection/EnhancedSelectionStorageTest.php b/tests/Core/FieldType/EnhancedSelection/EnhancedSelectionStorageTest.php index 6909dfa..f02f2d4 100644 --- a/tests/Core/FieldType/EnhancedSelection/EnhancedSelectionStorageTest.php +++ b/tests/Core/FieldType/EnhancedSelection/EnhancedSelectionStorageTest.php @@ -27,7 +27,7 @@ protected function setUp(): void { $this->gateway = $this->getMockBuilder(EnhancedSelectionStorage\Gateway\DoctrineStorage::class) ->disableOriginalConstructor() - ->setMethods(['deleteFieldData', 'storeFieldData', 'getFieldData']) + ->onlyMethods(['deleteFieldData', 'storeFieldData', 'getFieldData']) ->getMock(); $this->storage = new EnhancedSelectionStorage($this->gateway); diff --git a/tests/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/EnhancedSelectionTest.php b/tests/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/EnhancedSelectionTest.php index 36b6184..e2ca1a1 100644 --- a/tests/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/EnhancedSelectionTest.php +++ b/tests/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/EnhancedSelectionTest.php @@ -38,7 +38,7 @@ protected function setUp(): void $this->db = $this->getMockBuilder(ConnectionHandler::class) ->disableOriginalConstructor() - ->setMethods(['createSelectQuery', 'quoteColumn']) + ->onlyMethods(['createSelectQuery', 'quoteColumn']) ->getMock(); $this->handler = new EnhancedSelection($this->db); @@ -65,7 +65,6 @@ public function testHandleWithoutFieldDefinitions(): void $criteriaConverter = $this->getMockBuilder(CriteriaConverter::class) ->disableOriginalConstructor() - ->setMethods([]) ->getMock(); $connection = $this->getMockBuilder(Connection::class) @@ -74,12 +73,12 @@ public function testHandleWithoutFieldDefinitions(): void $query = $this->getMockBuilder(SelectDoctrineQuery::class) ->setConstructorArgs([$connection]) - ->setMethods(['prepare']) + ->onlyMethods(['prepare']) ->getMock(); $statement = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() - ->setMethods(['execute', 'fetchAll']) + ->onlyMethods(['execute', 'fetchAll']) ->getMock(); $statement->expects(self::once()) @@ -104,7 +103,6 @@ public function testHandle(): void { $criteriaConverter = $this->getMockBuilder(CriteriaConverter::class) ->disableOriginalConstructor() - ->setMethods([]) ->getMock(); $connection = $this->getMockBuilder(Connection::class) @@ -113,12 +111,12 @@ public function testHandle(): void $query = $this->getMockBuilder(SelectDoctrineQuery::class) ->setConstructorArgs([$connection]) - ->setMethods(['prepare']) + ->onlyMethods(['prepare']) ->getMock(); $statement = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() - ->setMethods(['execute', 'fetchAll']) + ->onlyMethods(['execute', 'fetchAll']) ->getMock(); $statement->expects(self::once()) diff --git a/tests/Form/FieldTypeHandler/EnhancedSelectionTest.php b/tests/Form/FieldTypeHandler/EnhancedSelectionTest.php index 9a9c81b..4451881 100644 --- a/tests/Form/FieldTypeHandler/EnhancedSelectionTest.php +++ b/tests/Form/FieldTypeHandler/EnhancedSelectionTest.php @@ -27,7 +27,7 @@ class EnhancedSelectionTest extends TestCase protected function setUp(): void { $this->configResolver = $this->getMockBuilder(ConfigResolverInterface::class) - ->setMethods(['hasParameter', 'getParameter', 'setDefaultNamespace', 'getDefaultNamespace']) + ->onlyMethods(['hasParameter', 'getParameter', 'setDefaultNamespace', 'getDefaultNamespace']) ->disableOriginalConstructor() ->getMock(); @@ -114,7 +114,7 @@ public function testBuildFieldCreateForm(): void { $formBuilder = $this->getMockBuilder(FormBuilder::class) ->disableOriginalConstructor() - ->setMethods(['add']) + ->onlyMethods(['add']) ->getMock(); $formBuilder->expects(self::once()) diff --git a/tests/Templating/Twig/NetgenEnhancedSelectionRuntimeTest.php b/tests/Templating/Twig/NetgenEnhancedSelectionRuntimeTest.php index b6c2a0f..c6a414b 100644 --- a/tests/Templating/Twig/NetgenEnhancedSelectionRuntimeTest.php +++ b/tests/Templating/Twig/NetgenEnhancedSelectionRuntimeTest.php @@ -37,12 +37,12 @@ protected function setUp(): void { $this->translationHelper = $this->getMockBuilder(TranslationHelper::class) ->disableOriginalConstructor() - ->setMethods(['getTranslatedField']) + ->onlyMethods(['getTranslatedField']) ->getMock(); $this->contentTypeService = $this->getMockBuilder(ContentTypeService::class) ->disableOriginalConstructor() - ->setMethods(['loadContentType']) + ->onlyMethods(['loadContentType']) ->getMockForAbstractClass(); $this->runtime = new NetgenEnhancedSelectionRuntime($this->contentTypeService, $this->translationHelper);