From 1b18b76d595b3e748c5714a2e2762b128469add2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mei=C3=9Fner?= Date: Tue, 7 Nov 2023 19:08:04 +0100 Subject: [PATCH] update to guzzlehttp/guzzle 7 and fix tests --- composer.json | 2 +- phpunit.xml.dist | 28 ++++++++++++---------------- tests/ClientTest.php | 2 +- tests/ComponentDataRetrieverTest.php | 4 ++-- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index 4744700..ee89c9b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } }, "require": { - "guzzlehttp/guzzle": "~6.0" + "guzzlehttp/guzzle": "^7.8" }, "require-dev": { "phpunit/phpunit": "*", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c5279ee..77a122b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,18 +1,14 @@ - - - - ./tests - - - - - - ./src/ - - + + + + + ./tests + + + + + ./src/ + + diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 41106a9..5c0db16 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -70,7 +70,7 @@ public function testRenderComponents() ]); $this->assertEquals(2, count($components['html'])); - $this->assertRegexp('/script/', $components['html'][0]); + $this->assertMatchesRegularExpression('/script/', $components['html'][0]); } public function mockComponentDataRetriever($config) diff --git a/tests/ComponentDataRetrieverTest.php b/tests/ComponentDataRetrieverTest.php index c3594ff..cb0b3d5 100644 --- a/tests/ComponentDataRetrieverTest.php +++ b/tests/ComponentDataRetrieverTest.php @@ -39,7 +39,7 @@ public function testRequestMethodForOneComp() $compDataRetriever = $this->getMockBuilder(ComponentDataRetriever::class) ->setConstructorArgs([$this->config]) - ->setMethods(['performGet']) + ->onlyMethods(['performGet']) ->getMock(); $compDataRetriever->expects($this->once()) ->method('performGet'); @@ -52,7 +52,7 @@ public function testRequestMethodForOneComp() $twoComp['components'][] = 'some-other-component'; $compDataRetrieverTwo = $this->getMockBuilder(ComponentDataRetriever::class) ->setConstructorArgs([$twoComp]) - ->setMethods(['performPost']) + ->onlyMethods(['performPost']) ->getMock(); $compDataRetrieverTwo->expects($this->once()) ->method('performPost');