Skip to content

Commit 9ba49e3

Browse files
committed
fix error message in tests
1 parent 02cb1d7 commit 9ba49e3

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## Release notes for the ArangoDB-PHP driver 3.8.x
4+
5+
This version of the PHP driver removes support for the MMFiles storage engine, which was
6+
deprecated in the arangod server in version 3.6.0, and removed in version 3.7.0..
7+
8+
Updating, replacing or removing documents in the database using a revision id guard value
9+
may return a different error message in case the revision id value of the found document is
10+
not as expected.
11+
Previous versions before 3.7 returned HTTP error 412, an ArangoDB error code 1200 and the
12+
error message string "precondition failed". This was changed in version 3.7 to return the
13+
same error codes, but an error message string of "conflict". Version 3.8 changes this again
14+
so the error message string is now "conflict, _rev values do not match".
15+
16+
317
## Release notes for the ArangoDB-PHP driver 3.7.x
418

519
The corresponding ArangoDB version, ArangoDB 3.7 has dropped support for the MMFiles storage

tests/DocumentExtendedTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ public function testCreateUpdateGetAndDeleteDocumentWithRevisionCheck()
642642
static::assertInstanceOf(\Exception::class, $e);
643643
static::assertEquals(412, $e->getCode());
644644
static::assertEquals(1200, $e->getServerCode());
645-
static::assertEquals('conflict', $e->getMessage());
645+
static::assertEquals('conflict, _rev values do not match', $e->getMessage());
646646
$resultingDocument1 = $documentHandler->get($this->collection->getName(), $documentId);
647647

648648
static::assertEquals(
@@ -689,7 +689,7 @@ public function testCreateUpdateGetAndDeleteDocumentWithRevisionCheck()
689689
static::assertInstanceOf(\Exception::class, $e, 'Delete should have raised an exception here');
690690
static::assertEquals(412, $e->getCode());
691691
static::assertEquals(1200, $e->getServerCode());
692-
static::assertEquals('conflict', $e->getMessage());
692+
static::assertEquals('conflict, _rev values do not match', $e->getMessage());
693693
unset ($e);
694694

695695
$response = $documentHandler->remove($resultingDocument3, ['policy' => 'error']);
@@ -750,7 +750,7 @@ public function testMoreCreateUpdateGetAndDeleteDocumentWithRevisionCheck()
750750
static::assertInstanceOf(\Exception::class, $e);
751751
static::assertEquals(412, $e->getCode());
752752
static::assertEquals(1200, $e->getServerCode());
753-
static::assertEquals('conflict', $e->getMessage());
753+
static::assertEquals('conflict, _rev values do not match', $e->getMessage());
754754
$resultingDocument1 = $documentHandler->get($this->collection->getName(), $documentId);
755755

756756
static::assertEquals($resultingDocument1->someAttribute, 'someValue2');
@@ -797,7 +797,7 @@ public function testMoreCreateUpdateGetAndDeleteDocumentWithRevisionCheck()
797797
static::assertInstanceOf(\Exception::class, $e, 'Delete should have raised an exception here');
798798
static::assertEquals(412, $e->getCode());
799799
static::assertEquals(1200, $e->getServerCode());
800-
static::assertEquals('conflict', $e->getMessage());
800+
static::assertEquals('conflict, _rev values do not match', $e->getMessage());
801801
unset ($e);
802802

803803
$response = $documentHandler->remove($resultingDocument3, ['policy' => 'error']);
@@ -923,7 +923,7 @@ public function testCreateSetNullAttributeUpdateGetAndDeleteDocumentWithRevision
923923
static::assertInstanceOf(\Exception::class, $e, 'Delete should have raised an exception here');
924924
static::assertEquals(412, $e->getCode());
925925
static::assertEquals(1200, $e->getServerCode());
926-
static::assertEquals('conflict', $e->getMessage());
926+
static::assertEquals('conflict, _rev values do not match', $e->getMessage());
927927
unset ($e);
928928

929929
$response = $documentHandler->remove($resultingDocument3, ['policy' => 'error']);

0 commit comments

Comments
 (0)