From ccea55fd7b2b66b58792607b3b9cb38483232c7c Mon Sep 17 00:00:00 2001 From: Pavel Pavlov Date: Fri, 1 Apr 2022 14:43:55 +0300 Subject: [PATCH] Update guzzlehttp/psr7 dependency & smallfix in test --- composer.json | 2 +- tests/Adapters/Redis/RedisConnectionTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index f174068..95f6176 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": "~7.1 || ^8.0", - "guzzlehttp/psr7": "~1.4" + "guzzlehttp/psr7": "~1.4 || ^2.0" }, "require-dev": { "ext-json": "*", diff --git a/tests/Adapters/Redis/RedisConnectionTest.php b/tests/Adapters/Redis/RedisConnectionTest.php index bbd80d6..de8b5b0 100644 --- a/tests/Adapters/Redis/RedisConnectionTest.php +++ b/tests/Adapters/Redis/RedisConnectionTest.php @@ -20,7 +20,7 @@ final class RedisConnectionTest extends TestCase protected function setUp(): void { $this->redis = $this->createMock(\Redis::class); - $this->redisConnection = new RedisConnection($this->redis, static::METRICS_KEY); + $this->redisConnection = new RedisConnection($this->redis, self::METRICS_KEY); } public function testReceivingAllMetrics(): void @@ -28,7 +28,7 @@ public function testReceivingAllMetrics(): void $this->redis ->expects($this->once()) ->method('hgetall') - ->with(static::METRICS_KEY) + ->with(self::METRICS_KEY) ->willReturn([ '{"name":"test1","tags":"{\"status\":15,\"port\":1}"}' => '17', '{"name":"test2","tags":"{\"severity\":\"high\"}"}' => '2', @@ -50,7 +50,7 @@ public function testAdjustMetric(): void $this->redis ->expects($this->once()) ->method('hincrbyfloat') - ->with(static::METRICS_KEY, $expectedField, $value) + ->with(self::METRICS_KEY, $expectedField, $value) ->willReturn(17); $actual = $this->redisConnection->adjustMetric('test', $value, ['severity' => 'high']); @@ -66,7 +66,7 @@ public function testSetMetrics(): void $this->redis ->expects($this->once()) ->method('hmset') - ->with(static::METRICS_KEY, $fields) + ->with(self::METRICS_KEY, $fields) ->willReturn(false); $metrics = [ new MetricDto('test1', 17, ['status' => 15, 'port' => 1]), @@ -82,7 +82,7 @@ public function testGetMetricValue(): void $this->redis ->expects($this->once()) ->method('hget') - ->with(static::METRICS_KEY, $expectedField) + ->with(self::METRICS_KEY, $expectedField) ->willReturn('17'); $actual = $this->redisConnection->getMetricValue('test', ['severity' => 'high']); @@ -95,7 +95,7 @@ public function testFailedGetMetricValue(): void $this->redis ->expects($this->once()) ->method('hget') - ->with(static::METRICS_KEY, $expectedField) + ->with(self::METRICS_KEY, $expectedField) ->willReturn(false); $actual = $this->redisConnection->getMetricValue('test', ['severity' => 'high']);