Skip to content

Commit

Permalink
Update guzzlehttp/psr7 dependency & smallfix in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Pavlov authored and scaytrase committed Apr 1, 2022
1 parent 3c5ed37 commit ccea55f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "~7.1 || ^8.0",
"guzzlehttp/psr7": "~1.4"
"guzzlehttp/psr7": "~1.4 || ^2.0"
},
"require-dev": {
"ext-json": "*",
Expand Down
12 changes: 6 additions & 6 deletions tests/Adapters/Redis/RedisConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ 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
{
$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',
Expand All @@ -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']);
Expand All @@ -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]),
Expand All @@ -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']);
Expand All @@ -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']);
Expand Down

0 comments on commit ccea55f

Please sign in to comment.