Skip to content

Commit

Permalink
qa: add failing unit test for multi mode detection
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Jul 3, 2023
1 parent cb64960 commit 9af1db5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/integration/Laminas/RedisClusterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
namespace LaminasTest\Cache\Storage\Adapter\Laminas;

use Laminas\Cache\Storage\Adapter\AbstractAdapter;
use Laminas\Cache\Storage\Adapter\Exception\RedisRuntimeException;
use Laminas\Cache\Storage\Adapter\RedisCluster;
use Laminas\Cache\Storage\Adapter\RedisClusterOptions;
use Laminas\Cache\Storage\Adapter\RedisClusterOptionsFromIni;
use Laminas\Cache\Storage\Adapter\RedisClusterResourceManager;
use Laminas\Cache\Storage\Plugin\Serializer;
use Laminas\Cache\Storage\StorageInterface;
use LaminasTest\Cache\Storage\Adapter\AbstractCommonAdapterTest;
Expand Down Expand Up @@ -133,6 +135,17 @@ public function testClearsByNamespace(): void
self::assertEquals($result['qoo'], 'ooq');
}

public function testCanHandleMultiMode(): void
{
$resourceManager = new RedisClusterResourceManager($this->options);

Check failure on line 140 in test/integration/Laminas/RedisClusterTest.php

View workflow job for this annotation

GitHub Actions / QA Checks (Psalm [8.0, locked], ubuntu-latest, laminas/laminas-continuous-integration-action@v1, ...

PossiblyNullArgument

test/integration/Laminas/RedisClusterTest.php:140:60: PossiblyNullArgument: Argument 1 of Laminas\Cache\Storage\Adapter\RedisClusterResourceManager::__construct cannot be null, possibly null value provided (see https://psalm.dev/078)
$resource = $resourceManager->getResource();
$resource->multi();

$this->expectException(RedisRuntimeException::class);
$this->expectExceptionMessage('multi block');
$this->storage->getItems(['foo', 'bar']);

Check failure on line 146 in test/integration/Laminas/RedisClusterTest.php

View workflow job for this annotation

GitHub Actions / QA Checks (Psalm [8.0, locked], ubuntu-latest, laminas/laminas-continuous-integration-action@v1, ...

PossiblyNullReference

test/integration/Laminas/RedisClusterTest.php:146:25: PossiblyNullReference: Cannot call method getItems on possibly null value (see https://psalm.dev/083)
}

protected function setUp(): void
{
$this->storage = $this->createRedisClusterStorage(
Expand Down

0 comments on commit 9af1db5

Please sign in to comment.