File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 66use Typesense \Client ;
77use Mockery ;
88use Typesense \ApiCall ;
9+ use Exception ;
910
1011abstract class TestCase extends BaseTestCase
1112{
@@ -98,4 +99,25 @@ protected function tearDownTypesense(): void
9899 $ this ->typesenseClient ->collections [$ collection ['name ' ]]->delete ();
99100 }
100101 }
102+
103+ protected function isV30OrAbove (): bool
104+ {
105+ try {
106+ $ debug = $ this ->typesenseClient ->debug ->retrieve ();
107+ $ version = $ debug ['version ' ];
108+
109+ if ($ version === 'nightly ' ) {
110+ return true ;
111+ }
112+
113+ if (preg_match ('/^v(\d+)/ ' , $ version , $ matches )) {
114+ $ majorVersion = (int ) $ matches [1 ];
115+ return $ majorVersion >= 30 ;
116+ }
117+
118+ return false ;
119+ } catch (Exception $ e ) {
120+ return false ;
121+ }
122+ }
101123}
You can’t perform that action at this time.
0 commit comments