Skip to content

Commit 9fbcf87

Browse files
Updated tests for ArangoDB 3.8
1 parent b42a44d commit 9fbcf87

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
</include>
1717
</coverage>
1818
<php>
19-
<env name="ARANGODB_VERSION" value="3.7"/>
19+
<env name="ARANGODB_VERSION" value="3.8"/>
2020
</php>
2121
</phpunit>

tests/ArangoClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,6 @@ protected function checkHttp2Support()
265265
$this->markTestSkipped('The installed version of CURL does not support the HTTP2 protocol.');
266266
}
267267
// HTTP/2 is only supported by ArangoDB 3.7 and up.
268-
$this->skipTestOnArangoVersionsBefore('3.7');
268+
$this->skipTestOnArangoVersions('3.7');
269269
}
270-
}
270+
}

tests/SchemaManagerCollectionsTest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@
77
class SchemaManagerCollectionsTest extends TestCase
88
{
99

10-
public function testGetCollections()
10+
public function testGetCollectionsBeforeVersion38()
1111
{
12+
$this->skipTestOnArangoVersions('3.8', '>=');
1213
$result = $this->schemaManager->getCollections();
1314

1415
$this->assertLessThanOrEqual(count($result), 10);
1516
$this->assertIsObject($result[0]);
1617
}
1718

19+
public function testGetCollections()
20+
{
21+
$this->skipTestOnArangoVersions('3.8', '<');
22+
$result = $this->schemaManager->getCollections();
23+
24+
$this->assertLessThanOrEqual(count($result), 8);
25+
$this->assertIsObject($result[0]);
26+
}
27+
1828
public function testGetCollectionsWithoutSystem()
1929
{
2030
$result = $this->schemaManager->getCollections(true);
@@ -35,7 +45,7 @@ public function testGetCollection()
3545

3646
public function testHasCollection()
3747
{
38-
$result = $this->schemaManager->hasCollection('_fishbowl');
48+
$result = $this->schemaManager->hasCollection('_graphs');
3949
$this->assertTrue($result);
4050

4151
$result = $this->schemaManager->hasCollection('someNoneExistingCollection');
@@ -190,4 +200,4 @@ public function testCreateCollectionWithOptions()
190200
$this->assertTrue($result);
191201
$this->assertFalse($this->schemaManager->hasCollection($collection));
192202
}
193-
}
203+
}

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ protected function createTestDatabase()
4141
}
4242
}
4343

44-
protected function skipTestOnArangoVersionsBefore(string $version)
44+
protected function skipTestOnArangoVersions(string $version, string $operator = '<')
4545
{
46-
if (version_compare( getenv('ARANGODB_VERSION'), $version, '<' )) {
46+
if (version_compare( getenv('ARANGODB_VERSION'), $version, $operator )) {
4747
$this->markTestSkipped('This test does not support ArangoDB versions before ' . $version);
4848
}
4949
}

0 commit comments

Comments
 (0)