Skip to content

Commit 852e3d3

Browse files
Update exception messages in document deletion tests for clarity
1 parent 6e75286 commit 852e3d3

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

tests/e2e/Adapter/Scopes/DocumentTests.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,12 +3965,12 @@ public function testDeleteBulkDocuments(): void
39653965
],
39663966
batchSize: 1,
39673967
onNext: function () {
3968-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
3968+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
39693969
},
39703970
onError:function ($e) {
39713971
if ($e instanceof Exception) {
39723972
$this->assertInstanceOf(Exception::class, $e);
3973-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
3973+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
39743974
} else {
39753975
$this->fail("Caught value is not an Exception.");
39763976
}
@@ -3981,11 +3981,11 @@ public function testDeleteBulkDocuments(): void
39813981

39823982
// TEST: Bulk Delete All Documents
39833983
$this->assertEquals(8, $database->deleteDocuments('bulk_delete', onNext: function () {
3984-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
3984+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
39853985
}, onError:function ($e) {
39863986
if ($e instanceof Exception) {
39873987
$this->assertInstanceOf(Exception::class, $e);
3988-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
3988+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
39893989
} else {
39903990
$this->fail("Caught value is not an Exception.");
39913991
}
@@ -4002,11 +4002,11 @@ public function testDeleteBulkDocuments(): void
40024002
Query::greaterThanEqual('integer', 5)
40034003
], onNext: function ($doc) use (&$results) {
40044004
$results[] = $doc;
4005-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
4005+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
40064006
}, onError:function ($e) {
40074007
if ($e instanceof Exception) {
40084008
$this->assertInstanceOf(Exception::class, $e);
4009-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
4009+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
40104010
} else {
40114011
$this->fail("Caught value is not an Exception.");
40124012
}
@@ -4027,11 +4027,11 @@ public function testDeleteBulkDocuments(): void
40274027
try {
40284028
$this->getDatabase()->withRequestTimestamp($oneHourAgo, function () {
40294029
return $this->getDatabase()->deleteDocuments('bulk_delete', onNext: function () {
4030-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
4030+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
40314031
}, onError:function ($e) {
40324032
if ($e instanceof Exception) {
40334033
$this->assertInstanceOf(Exception::class, $e);
4034-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
4034+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
40354035
} else {
40364036
$this->fail("Caught value is not an Exception.");
40374037
}
@@ -4080,11 +4080,11 @@ public function testDeleteBulkDocuments(): void
40804080
], false);
40814081

40824082
$database->deleteDocuments('bulk_delete', onNext: function () {
4083-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
4083+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
40844084
}, onError:function ($e) {
40854085
if ($e instanceof Exception) {
40864086
$this->assertInstanceOf(Exception::class, $e);
4087-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
4087+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
40884088
} else {
40894089
$this->fail("Caught value is not an Exception.");
40904090
}
@@ -4134,23 +4134,23 @@ public function testDeleteBulkDocumentsQueries(): void
41344134
$this->propagateBulkDocuments('bulk_delete_queries');
41354135

41364136
$this->assertEquals(5, $database->deleteDocuments('bulk_delete_queries', [Query::limit(5)], onNext: function () {
4137-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
4137+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
41384138
}, onError:function ($e) {
41394139
if ($e instanceof Exception) {
41404140
$this->assertInstanceOf(Exception::class, $e);
4141-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
4141+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
41424142
} else {
41434143
$this->fail("Caught value is not an Exception.");
41444144
}
41454145
}));
41464146
$this->assertEquals(5, \count($database->find('bulk_delete_queries')));
41474147

41484148
$this->assertEquals(5, $database->deleteDocuments('bulk_delete_queries', [Query::limit(5)], onNext: function () {
4149-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
4149+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
41504150
}, onError:function ($e) {
41514151
if ($e instanceof Exception) {
41524152
$this->assertInstanceOf(Exception::class, $e);
4153-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
4153+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
41544154
} else {
41554155
$this->fail("Caught value is not an Exception.");
41564156
}

tests/e2e/Adapter/Scopes/Relationships/ManyToManyTests.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,11 +1582,11 @@ public function testDeleteBulkDocumentsManyToManyRelationship(): void
15821582
// Delete person
15831583
try {
15841584
$this->getDatabase()->deleteDocuments('bulk_delete_person_m2m', onNext: function () {
1585-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
1585+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
15861586
}, onError:function ($e) {
15871587
if ($e instanceof Exception) {
15881588
$this->assertInstanceOf(Exception::class, $e);
1589-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
1589+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
15901590
} else {
15911591
$this->fail("Caught value is not an Exception.");
15921592
}
@@ -1599,23 +1599,23 @@ public function testDeleteBulkDocumentsManyToManyRelationship(): void
15991599
// Restrict Cleanup
16001600
$this->getDatabase()->deleteRelationship('bulk_delete_person_m2m', 'bulk_delete_library_m2m');
16011601
$this->getDatabase()->deleteDocuments('bulk_delete_library_m2m', onNext: function () {
1602-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
1602+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
16031603
}, onError:function ($e) {
16041604
if ($e instanceof Exception) {
16051605
$this->assertInstanceOf(Exception::class, $e);
1606-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
1606+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
16071607
} else {
16081608
$this->fail("Caught value is not an Exception.");
16091609
}
16101610
});
16111611
$this->assertCount(0, $this->getDatabase()->find('bulk_delete_library_m2m'));
16121612

16131613
$this->getDatabase()->deleteDocuments('bulk_delete_person_m2m', onNext: function () {
1614-
throw new Exception("Error thrown to test update doesn't stopped and error is caught");
1614+
throw new Exception("Error thrown to test that deletion doesn't stop and error is caught");
16151615
}, onError:function ($e) {
16161616
if ($e instanceof Exception) {
16171617
$this->assertInstanceOf(Exception::class, $e);
1618-
$this->assertEquals("Error thrown to test update doesn't stopped and error is caught", $e->getMessage());
1618+
$this->assertEquals("Error thrown to test that deletion doesn't stop and error is caught", $e->getMessage());
16191619
} else {
16201620
$this->fail("Caught value is not an Exception.");
16211621
}

0 commit comments

Comments
 (0)