mirror of
https://github.com/predis/predis.git
synced 2026-10-11 06:17:10 +00:00
b8cc7c643a
* Added support for COPY command * Revert getCLient signature changes, used createClient instead Co-authored-by: Vladyslav Vildanov <vladyslavvildanov@Vladyslav-Vildanov-MacBook-Pro.local>
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Predis\Command\Traits;
|
|
|
|
use Predis\Command\Command as RedisCommand;
|
|
use PredisTestCase;
|
|
|
|
class ReplaceTest extends PredisTestCase
|
|
{
|
|
private $testClass;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->testClass = new class extends RedisCommand {
|
|
use Replace;
|
|
|
|
public function getId()
|
|
{
|
|
return 'test';
|
|
}
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @dataProvider argumentsProvider
|
|
* @param array $arguments
|
|
* @param array $expectedResponse
|
|
* @return void
|
|
*/
|
|
public function testReturnsCorrectArguments(array $arguments, array $expectedResponse): void
|
|
{
|
|
$this->testClass->setArguments($arguments);
|
|
|
|
$this->assertSame($expectedResponse, $this->testClass->getArguments());
|
|
}
|
|
|
|
public function argumentsProvider(): array
|
|
{
|
|
return [
|
|
'with boolean - true' => [[true],['REPLACE']],
|
|
'with boolean - false' => [[false], []],
|
|
'with non boolean' => [['string'], ['string']],
|
|
];
|
|
}
|
|
}
|