diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index 7ca371a1..1003a019 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -32,7 +32,6 @@ jobs: - '8.1' - '8.2' redis: - - latest - edge steps: diff --git a/tests/Predis/Command/Redis/Json/JSONARRAPPEND_Test.php b/tests/Predis/Command/Redis/Json/JSONARRAPPEND_Test.php index 0f4292c2..2d58cd6b 100644 --- a/tests/Predis/Command/Redis/Json/JSONARRAPPEND_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONARRAPPEND_Test.php @@ -102,7 +102,7 @@ class JSONARRAPPEND_Test extends PredisCommandTestCase $actualResponse = $redis->jsonarrappend('key', '$.key2', '"value3"'); $this->assertSame([3], $actualResponse); - $this->assertSame([['{"key1":"value1","key2":["value1","value2","value3"]}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1","key2":["value1","value2","value3"]}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONARRINSERT_Test.php b/tests/Predis/Command/Redis/Json/JSONARRINSERT_Test.php index 9309e0a7..6701aa62 100644 --- a/tests/Predis/Command/Redis/Json/JSONARRINSERT_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONARRINSERT_Test.php @@ -104,7 +104,7 @@ class JSONARRINSERT_Test extends PredisCommandTestCase $actualResponse = $redis->jsonarrinsert('key', '$.key2', 1, '"value2"'); $this->assertSame([3], $actualResponse); - $this->assertSame([['{"key1":"value1","key2":["value1","value2","value3"]}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1","key2":["value1","value2","value3"]}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONARRPOP_Test.php b/tests/Predis/Command/Redis/Json/JSONARRPOP_Test.php index 089da648..dc030257 100644 --- a/tests/Predis/Command/Redis/Json/JSONARRPOP_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONARRPOP_Test.php @@ -100,7 +100,7 @@ class JSONARRPOP_Test extends PredisCommandTestCase $actualResponse = $redis->jsonarrpop('key', '$.key2', -1); $this->assertSame(['"value2"'], $actualResponse); - $this->assertSame([['{"key1":"value1","key2":["value1"]}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1","key2":["value1"]}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONARRTRIM_Test.php b/tests/Predis/Command/Redis/Json/JSONARRTRIM_Test.php index f032303c..2f251f53 100644 --- a/tests/Predis/Command/Redis/Json/JSONARRTRIM_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONARRTRIM_Test.php @@ -102,7 +102,7 @@ class JSONARRTRIM_Test extends PredisCommandTestCase $actualResponse = $redis->jsonarrtrim('key', '$.key2', 1, 4); $this->assertSame([4], $actualResponse); - $this->assertSame([['{"key1":"value1","key2":[2,3,4,5]}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1","key2":[2,3,4,5]}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONCLEAR_Test.php b/tests/Predis/Command/Redis/Json/JSONCLEAR_Test.php index e2fb9888..bef31dae 100644 --- a/tests/Predis/Command/Redis/Json/JSONCLEAR_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONCLEAR_Test.php @@ -98,7 +98,7 @@ class JSONCLEAR_Test extends PredisCommandTestCase $actualResponse = $redis->jsonclear('key', '$.key2'); $this->assertSame(1, $actualResponse); - $this->assertSame([['{"key1":"value1","key2":[]}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1","key2":[]}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONDEL_Test.php b/tests/Predis/Command/Redis/Json/JSONDEL_Test.php index 1c948666..58cfc953 100644 --- a/tests/Predis/Command/Redis/Json/JSONDEL_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONDEL_Test.php @@ -98,7 +98,7 @@ class JSONDEL_Test extends PredisCommandTestCase $actualResponse = $redis->jsondel('key', '$.key2'); $this->assertSame(1, $actualResponse); - $this->assertSame([['{"key1":"value1"}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1"}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONFORGET_Test.php b/tests/Predis/Command/Redis/Json/JSONFORGET_Test.php index fd089739..329462ad 100644 --- a/tests/Predis/Command/Redis/Json/JSONFORGET_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONFORGET_Test.php @@ -98,7 +98,7 @@ class JSONFORGET_Test extends PredisCommandTestCase $actualResponse = $redis->jsonforget('key', '$.key2'); $this->assertSame(1, $actualResponse); - $this->assertSame([['{"key1":"value1"}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1"}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONGET_Test.php b/tests/Predis/Command/Redis/Json/JSONGET_Test.php index 47142d06..befe0174 100644 --- a/tests/Predis/Command/Redis/Json/JSONGET_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONGET_Test.php @@ -94,7 +94,7 @@ class JSONGET_Test extends PredisCommandTestCase $redis->jsonset('key', '$', '{"key1":"value1","key2":"value2"}'); $this->assertSame( - [['{"key1":"value1","key2":"value2"}']], + '[{"key1":"value1","key2":"value2"}]', $redis->jsonget('key') ); } diff --git a/tests/Predis/Command/Redis/Json/JSONOBJKEYS_Test.php b/tests/Predis/Command/Redis/Json/JSONOBJKEYS_Test.php index a14dd300..9ec783b1 100644 --- a/tests/Predis/Command/Redis/Json/JSONOBJKEYS_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONOBJKEYS_Test.php @@ -92,7 +92,7 @@ class JSONOBJKEYS_Test extends PredisCommandTestCase $redis->jsonset('key', '$', '{"key1":"value1","key2":"value2"}'); - $this->assertSame(['key1', 'key2'], $redis->jsonobjkeys('key')); + $this->assertSame([['key1', 'key2']], $redis->jsonobjkeys('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONOBJLEN_Test.php b/tests/Predis/Command/Redis/Json/JSONOBJLEN_Test.php index ad16e9a8..c4e29c52 100644 --- a/tests/Predis/Command/Redis/Json/JSONOBJLEN_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONOBJLEN_Test.php @@ -92,7 +92,7 @@ class JSONOBJLEN_Test extends PredisCommandTestCase $redis->jsonset('key', '$', '{"key1":"value1","key2":"value2"}'); - $this->assertSame(2, $redis->jsonobjlen('key')); + $this->assertSame([2], $redis->jsonobjlen('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONSET_Test.php b/tests/Predis/Command/Redis/Json/JSONSET_Test.php index 92b1b696..e4267e64 100644 --- a/tests/Predis/Command/Redis/Json/JSONSET_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONSET_Test.php @@ -97,7 +97,7 @@ class JSONSET_Test extends PredisCommandTestCase $this->assertEquals('OK', $redis->jsonset('key', '$', '{"key1":"value1","key2":"value2"}')); $this->assertEquals('OK', $redis->jsonset('key', '$', '{"key3":"value3"}')); - $this->assertSame([['{"key3":"value3"}']], $redis->jsonget('key')); + $this->assertSame('[{"key3":"value3"}]', $redis->jsonget('key')); } /** diff --git a/tests/Predis/Command/Redis/Json/JSONSTRAPPEND_Test.php b/tests/Predis/Command/Redis/Json/JSONSTRAPPEND_Test.php index 3aa5d97f..02afb066 100644 --- a/tests/Predis/Command/Redis/Json/JSONSTRAPPEND_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONSTRAPPEND_Test.php @@ -100,7 +100,7 @@ class JSONSTRAPPEND_Test extends PredisCommandTestCase $actualResponse = $redis->jsonstrappend('key', '$.key2', '"foo"'); $this->assertSame([9], $actualResponse); - $this->assertSame([['{"key1":"value1","key2":"value2foo"}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":"value1","key2":"value2foo"}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Json/JSONTOGGLE_Test.php b/tests/Predis/Command/Redis/Json/JSONTOGGLE_Test.php index 207fa14a..20f19888 100644 --- a/tests/Predis/Command/Redis/Json/JSONTOGGLE_Test.php +++ b/tests/Predis/Command/Redis/Json/JSONTOGGLE_Test.php @@ -98,7 +98,7 @@ class JSONTOGGLE_Test extends PredisCommandTestCase $actualResponse = $redis->jsontoggle('key', '$.key1'); $this->assertSame([0], $actualResponse); - $this->assertSame([['{"key1":false}']], $redis->jsonget('key')); + $this->assertSame('[{"key1":false}]', $redis->jsonget('key')); } public function jsonProvider(): array diff --git a/tests/Predis/Command/Redis/Search/FTAGGREGATE_Test.php b/tests/Predis/Command/Redis/Search/FTAGGREGATE_Test.php index 9163c763..4d903ac3 100644 --- a/tests/Predis/Command/Redis/Search/FTAGGREGATE_Test.php +++ b/tests/Predis/Command/Redis/Search/FTAGGREGATE_Test.php @@ -122,12 +122,19 @@ class FTAGGREGATE_Test extends PredisCommandTestCase { $redis = $this->getResp3Client(); $expectedResponse = [ - 2, - [ - 'country', 'Ukraine', 'birth', '1995', 'country_birth_Vlad_count', '2', - ], - [ - 'country', 'Israel', 'birth', '1994', 'country_birth_Vlad_count', '1', + 'attributes' => [], + 'error' => [], + 'total_results' => 2, + 'format' => 'STRING', + 'results' => [ + [ + 'extra_attributes' => ['country' => 'Ukraine', 'birth' => '1995', 'country_birth_Vlad_count' => '2'], + 'values' => [], + ], + [ + 'extra_attributes' => ['country' => 'Israel', 'birth' => '1994', 'country_birth_Vlad_count' => '1'], + 'values' => [], + ], ], ]; diff --git a/tests/Predis/Command/Redis/Search/FTCONFIG_Test.php b/tests/Predis/Command/Redis/Search/FTCONFIG_Test.php index 3bf522a5..bafa0b46 100644 --- a/tests/Predis/Command/Redis/Search/FTCONFIG_Test.php +++ b/tests/Predis/Command/Redis/Search/FTCONFIG_Test.php @@ -133,7 +133,7 @@ class FTCONFIG_Test extends PredisCommandTestCase { $redis = $this->getResp3Client(); - $this->assertEquals([['MAXEXPANSIONS', '200']], $redis->ftconfig->get('MAXEXPANSIONS')); + $this->assertEquals(['MAXEXPANSIONS' => '200'], $redis->ftconfig->get('MAXEXPANSIONS')); $this->assertEmpty($redis->ftconfig->get('foobar')); } diff --git a/tests/Predis/Command/Redis/Search/FTCURSOR_Test.php b/tests/Predis/Command/Redis/Search/FTCURSOR_Test.php index 29b203b5..eef64b28 100644 --- a/tests/Predis/Command/Redis/Search/FTCURSOR_Test.php +++ b/tests/Predis/Command/Redis/Search/FTCURSOR_Test.php @@ -145,10 +145,28 @@ class FTCURSOR_Test extends PredisCommandTestCase $expectedResponse = [ [ - 'country', 'Ukraine', 'birth', '1995', 'country_birth_Vlad_count', '2', + 'attributes' => [], + 'error' => [], + 'total_results' => 2, + 'format' => 'STRING', + 'results' => [ + [ + 'extra_attributes' => ['country' => 'Ukraine', 'birth' => '1995', 'country_birth_Vlad_count' => '2'], + 'values' => [], + ], + ], ], [ - 'country', 'Israel', 'birth', '1994', 'country_birth_Vlad_count', '1', + 'attributes' => [], + 'error' => [], + 'total_results' => 0, + 'format' => 'STRING', + 'results' => [ + [ + 'extra_attributes' => ['country' => 'Israel', 'birth' => '1994', 'country_birth_Vlad_count' => '1'], + 'values' => [], + ], + ], ], ]; @@ -184,7 +202,7 @@ class FTCURSOR_Test extends PredisCommandTestCase $actualResponse = []; while ($cursor) { - $actualResponse[] = $response[1]; + $actualResponse[] = $response; [$response, $cursor] = $redis->ftcursor->read('idx', $cursor); } diff --git a/tests/Predis/Command/Redis/Search/FTINFO_Test.php b/tests/Predis/Command/Redis/Search/FTINFO_Test.php index 09913fcf..59d0eb63 100644 --- a/tests/Predis/Command/Redis/Search/FTINFO_Test.php +++ b/tests/Predis/Command/Redis/Search/FTINFO_Test.php @@ -105,7 +105,7 @@ class FTINFO_Test extends PredisCommandTestCase $this->assertEquals('OK', $createResponse); $actualResponse = $redis->ftinfo('index'); - $this->assertEquals('index', $actualResponse[1]); + $this->assertEquals('index', $actualResponse['index_name']); } /** diff --git a/tests/Predis/Command/Redis/Search/FTSEARCH_Test.php b/tests/Predis/Command/Redis/Search/FTSEARCH_Test.php index 8b5f6c4a..9e860995 100644 --- a/tests/Predis/Command/Redis/Search/FTSEARCH_Test.php +++ b/tests/Predis/Command/Redis/Search/FTSEARCH_Test.php @@ -131,7 +131,15 @@ class FTSEARCH_Test extends PredisCommandTestCase public function testSearchValuesByHashIndexResp3(): void { $redis = $this->getResp3Client(); - $expectedResponse = [1, 'doc:1', ['should_return', 'value1']]; + $expectedResponse = [ + 'attributes' => [], + 'error' => [], + 'total_results' => 1, + 'format' => 'STRING', + 'results' => [ + ['id' => 'doc:1', 'extra_attributes' => ['should_return' => 'value1'], 'values' => []], + ], + ]; $hashResponse = $redis->hmset('doc:1', 'field1', 'value1', 'field2', 'value2'); $this->assertEquals('OK', $hashResponse); diff --git a/tests/Predis/Command/Redis/Search/FTSPELLCHECK_Test.php b/tests/Predis/Command/Redis/Search/FTSPELLCHECK_Test.php index 846fbb6f..7754561c 100644 --- a/tests/Predis/Command/Redis/Search/FTSPELLCHECK_Test.php +++ b/tests/Predis/Command/Redis/Search/FTSPELLCHECK_Test.php @@ -94,7 +94,11 @@ class FTSPELLCHECK_Test extends PredisCommandTestCase public function testSpellcheckReturnsPossibleSuggestionsToGivenMisspelledTermResp3(): void { $redis = $this->getResp3Client(); - $expectedResponse = [['TERM', 'held', [[0.0, 'hello'], [0.0, 'help']]]]; + $expectedResponse = [ + 'results' => [ + 'held' => [['hello' => 0.0], ['help' => 0.0]], + ], + ]; $this->assertEquals('OK', $redis->ftcreate( 'index', diff --git a/tests/Predis/Command/Redis/Search/FTSYNDUMP_Test.php b/tests/Predis/Command/Redis/Search/FTSYNDUMP_Test.php index a079bc83..34ad47b5 100644 --- a/tests/Predis/Command/Redis/Search/FTSYNDUMP_Test.php +++ b/tests/Predis/Command/Redis/Search/FTSYNDUMP_Test.php @@ -91,7 +91,7 @@ class FTSYNDUMP_Test extends PredisCommandTestCase public function testDumpReturnsContentOfSynonymGroupFromGivenIndexResp3(): void { $redis = $this->getResp3Client(); - $expectedResponse = ['term1', ['synonym1'], 'term2', ['synonym1']]; + $expectedResponse = ['term1' => ['synonym1'], 'term2' => ['synonym1']]; $this->assertEquals( 'OK',