Skip to content

Commit 92a9909

Browse files
committed
Add decrease test for upsert with value
1 parent 5530801 commit 92a9909

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/e2e/Adapter/Base.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,21 @@ public function testCreateOrUpdateDocumentsWithIncrease(): void
23962396
foreach ($documents as $document) {
23972397
$this->assertEquals(6, $document->getAttribute('integer'));
23982398
}
2399+
2400+
$documents[0]->setAttribute('integer', -1);
2401+
$documents[1]->setAttribute('integer', -1);
2402+
2403+
static::getDatabase()->createOrUpdateDocumentsWithIncrease(
2404+
collection: $collection,
2405+
attribute:'integer',
2406+
documents: $documents
2407+
);
2408+
2409+
$documents = static::getDatabase()->find($collection);
2410+
2411+
foreach ($documents as $document) {
2412+
$this->assertEquals(5, $document->getAttribute('integer'));
2413+
}
23992414
}
24002415

24012416
public function testCreateOrUpdateDocumentsPermissions(): void

0 commit comments

Comments
 (0)