Skip to content

Commit b87a62b

Browse files
committed
disable feature tests if server version is incompatible
1 parent 11e3421 commit b87a62b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tests/CollectionBasicTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function setUp()
2727
$this->collectionHandler->create('ArangoDB_PHP_TestSuite_IndexTestCollection');
2828

2929
$adminHandler = new AdminHandler($this->connection);
30-
$version = $adminHandler->getServerVersion();
30+
$version = preg_replace("/-[a-z0-9]+$/", "", $adminHandler->getServerVersion());
3131

3232
$this->hasSparseIndexes = (version_compare($version, '2.5.0') >= 0);
3333
$this->hasSelectivityEstimates = (version_compare($version, '2.5.0') >= 0);

tests/ExportTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public function setUp()
3737
$this->collectionHandler->add($this->collection);
3838

3939
$this->documentHandler = new DocumentHandler($this->connection);
40+
41+
$adminHandler = new AdminHandler($this->connection);
42+
$version = preg_replace("/-[a-z0-9]+$/", "", $adminHandler->getServerVersion());
43+
$this->hasExportApi = (version_compare($version, '2.6.0') >= 0);
4044
}
4145

4246

@@ -45,6 +49,9 @@ public function setUp()
4549
*/
4650
public function testExportEmpty()
4751
{
52+
if (! $this->hasExportApi) {
53+
return;
54+
}
4855
$connection = $this->connection;
4956

5057
$export = new Export($connection, $this->collection, array());
@@ -67,6 +74,9 @@ public function testExportEmpty()
6774
*/
6875
public function testExportDocuments()
6976
{
77+
if (! $this->hasExportApi) {
78+
return;
79+
}
7080
$connection = $this->connection;
7181
for ($i = 0; $i < 100; ++$i) {
7282
$this->documentHandler->save($this->collection, array("value" => $i));
@@ -90,6 +100,9 @@ public function testExportDocuments()
90100
*/
91101
public function testExportDocumentsTwoFetches()
92102
{
103+
if (! $this->hasExportApi) {
104+
return;
105+
}
93106
$connection = $this->connection;
94107
$statement = new Statement($connection, array(
95108
"query" => "FOR i IN 1..1001 INSERT { _key: CONCAT('test', i), value: i } IN " . $this->collection->getName()
@@ -115,6 +128,9 @@ public function testExportDocumentsTwoFetches()
115128
*/
116129
public function testExportDocumentsMultipleFetches()
117130
{
131+
if (! $this->hasExportApi) {
132+
return;
133+
}
118134
$connection = $this->connection;
119135
$statement = new Statement($connection, array(
120136
"query" => "FOR i IN 1..5000 INSERT { _key: CONCAT('test', i), value: i } IN " . $this->collection->getName()
@@ -141,6 +157,9 @@ public function testExportDocumentsMultipleFetches()
141157
*/
142158
public function testExportDocumentsWithSmallBatchSize()
143159
{
160+
if (! $this->hasExportApi) {
161+
return;
162+
}
144163
$connection = $this->connection;
145164
$statement = new Statement($connection, array(
146165
"query" => "FOR i IN 1..5000 INSERT { _key: CONCAT('test', i), value: i } IN " . $this->collection->getName()

0 commit comments

Comments
 (0)