getCommand(); $command->setArguments($actualArguments); $this->assertSameValues($expectedArguments, $command->getArguments()); } /** * @group disconnected */ public function testParseResponse(): void { $this->assertSame(1, $this->getCommand()->parseResponse(1)); } /** * @group disconnected */ public function testPrefixKeys(): void { /** @var PrefixableCommand $command */ $command = $this->getCommand(); $actualArguments = ['arg1']; $prefix = 'prefix:'; $expectedArguments = ['prefix:arg1']; $command->setArguments($actualArguments); $command->prefixKeys($prefix); $this->assertSame($expectedArguments, $command->getArguments()); } /** * @group connected * @group relay-resp3 * @return void * @requiresRediSearchVersion >= 1.0.0 */ public function testRemovesAliasFromGivenIndex(): void { $redis = $this->getClient(); $schema = [new TextField('text_field')]; $this->assertEquals('OK', $redis->ftcreate('index', $schema)); $this->assertEquals('OK', $redis->ftaliasadd('alias', 'index')); $this->assertEquals('OK', $redis->ftaliasdel('alias')); } /** * @group connected * @return void * @requiresRediSearchVersion >= 2.8.0 */ public function testRemovesAliasFromGivenIndexResp3(): void { $redis = $this->getResp3Client(); $schema = [new TextField('text_field')]; $this->assertEquals('OK', $redis->ftcreate('index', $schema)); $this->assertEquals('OK', $redis->ftaliasadd('alias', 'index')); $this->assertEquals('OK', $redis->ftaliasdel('alias')); } /** * @group connected * @group relay-resp3 * @return void * @requiresRediSearchVersion >= 1.0.0 */ public function testThrowsExceptionOnNonExistingAlias(): void { $redis = $this->getClient(); $this->expectException(ServerException::class); $this->expectExceptionMessage('Alias does not exist'); $redis->ftaliasdel('alias'); } }