Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ public function getSizeOfCollection(string $collection): int
* @param string $id
*
* @return bool
* @throws DatabaseException
*/
public function deleteCollection(string $id): bool
{
Expand Down
17 changes: 17 additions & 0 deletions tests/e2e/Adapter/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ public function testCreateExistsDelete(): void
$this->assertEquals(true, static::getDatabase()->create());
}

public function testUpdateDeleteCollectionNotFound(): void
{
try {
static::getDatabase()->deleteCollection('not_found');
$this->fail('Failed to throw exception');
} catch (Exception $e) {
$this->assertEquals('Collection not found', $e->getMessage());
}

try {
static::getDatabase()->updateCollection('not_found', [], true);
$this->fail('Failed to throw exception');
} catch (Exception $e) {
$this->assertEquals('Collection not found', $e->getMessage());
}
}

public function testDeleteRelatedCollection(): void
{
if (!static::getDatabase()->getAdapter()->getSupportForRelationships()) {
Expand Down