Skip to content
This repository was archived by the owner on Jun 18, 2020. It is now read-only.

Commit 3a72d5a

Browse files
committed
Improve unit tests
1 parent dbe73f6 commit 3a72d5a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
command: ["vendor/bin/phpunit"]
2929

3030
arangodb:
31-
image: arangodb:3.2
31+
image: arangodb:3.2.9
3232
ports:
3333
- 8529:8529
3434
environment:

tests/ConnectionTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public function tearDown()
2424
{
2525
if ($this->connection) {
2626
TestUtil::deleteCollection($this->connection, 'event_streams');
27+
TestUtil::deleteCollection($this->connection, 'c6f955fd5efbc2cedbb5f97cfd8890bb98b364c1d');
28+
TestUtil::deleteCollection($this->connection, 'request_failed_exception_test');
2729
}
2830
}
2931

@@ -152,6 +154,7 @@ public function it_sends_large_request_via_post()
152154
$body = json_decode($response->getBody(), true);
153155

154156
$this->assertNotNull($body);
157+
$this->assertFalse($body['error']);
155158
$this->assertTrue(TestUtil::wasSuccessful($response), var_export($body, true));
156159
}
157160

@@ -397,11 +400,12 @@ public function it_throws_request_failed_exception_with_response_data()
397400
$this->assertTrue(false);
398401

399402
} catch(\ArangoDb\RequestFailedException $e) {
400-
$this->assertNotNull($e->getCode());
401-
$this->assertNotNull($e->getHttpCode());
403+
$this->assertSame(409, $e->getCode());
404+
$this->assertSame(409, $e->getHttpCode());
402405
$this->assertTrue($e->getCode() === $e->getHttpCode());
403406
$this->assertJson($e->getBody());
404407
$this->assertTrue(json_decode($e->getBody(), true)['errorMessage'] === 'duplicate name');
408+
$this->assertSame('duplicate name', $e->getMessage());
405409
}
406410
}
407411
}

tests/ExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use ArangoDb\Connection;
99

1010
/**
11-
* @group connection
11+
* @group exception
1212
*/
1313
class ExceptionTest extends TestCase
1414
{

tests/TestUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function getVpackCreateCollection(string $collectionName): Vpack
5858
return Vpack::fromArray([
5959
'name' => $collectionName,
6060
'keyOptions' => [
61-
'allowUserKeys' => false,
61+
'allowUserKeys' => true,
6262
'type' => 'autoincrement',
6363
'increment' => 1,
6464
'offset' => 1,

0 commit comments

Comments
 (0)