@@ -46,6 +46,28 @@ public function testIsUUIDSupported(bool $expected, bool $isMariaDb, int $versio
4646 self ::assertSame ($ expected , Compatibility::isUUIDSupported ($ dbiStub ));
4747 }
4848
49+ /** @return array<string, array{bool, bool, int}> */
50+ public static function providerForTestIsVectorSupported (): array
51+ {
52+ return [
53+ 'MySQL 8.99.99 ' => [false , false , 89999 ],
54+ 'MySQL 9.0.0 ' => [false , false , 90000 ],
55+ 'MariaDB 11.6.99 ' => [false , true , 110699 ],
56+ 'MariaDB 11.7.1 ' => [true , true , 110701 ],
57+ ];
58+ }
59+
60+ #[DataProvider('providerForTestIsVectorSupported ' )]
61+ public function testIsVectorSupported (bool $ expected , bool $ isMariaDb , int $ version ): void
62+ {
63+ $ dbiStub = self ::createStub (DatabaseInterface::class);
64+
65+ $ dbiStub ->method ('isMariaDB ' )->willReturn ($ isMariaDb );
66+ $ dbiStub ->method ('getVersion ' )->willReturn ($ version );
67+
68+ self ::assertSame ($ expected , Compatibility::isVectorSupported ($ dbiStub ));
69+ }
70+
4971 /**
5072 * @return mixed[][]
5173 * @psalm-return array<string, array{bool, bool, int}>
@@ -60,6 +82,28 @@ public static function providerForTestIsUUIDSupported(): array
6082 ];
6183 }
6284
85+ #[DataProvider('providerForTestIsJsonSupported ' )]
86+ public function testIsJsonSupported (bool $ expected , bool $ isMariaDb , int $ version ): void
87+ {
88+ $ dbiStub = self ::createStub (DatabaseInterface::class);
89+
90+ $ dbiStub ->method ('isMariaDB ' )->willReturn ($ isMariaDb );
91+ $ dbiStub ->method ('getVersion ' )->willReturn ($ version );
92+
93+ self ::assertSame ($ expected , Compatibility::isJsonSupported ($ dbiStub ));
94+ }
95+
96+ /** @return array<string, array{bool, bool, int}> */
97+ public static function providerForTestIsJsonSupported (): array
98+ {
99+ return [
100+ 'MySQL 5.7.7 ' => [false , false , 50707 ],
101+ 'MySQL 5.7.8 ' => [false , true , 50708 ],
102+ 'MariaDB 10.2.6 ' => [false , true , 100206 ],
103+ 'MariaDB 10.2.7 ' => [true , true , 100207 ],
104+ ];
105+ }
106+
63107 #[DataProvider('showBinLogStatusProvider ' )]
64108 public function testGetShowBinLogStatusStmt (string $ serverName , int $ version , string $ expected ): void
65109 {
0 commit comments