Skip to content

Commit 739a4c3

Browse files
* added support method in the mongodb adapter
* updated index unit tests
1 parent 49139d8 commit 739a4c3

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/Database/Adapter/Mongo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,6 +2788,11 @@ public function getSupportForBatchCreateAttributes(): bool
27882788
return true;
27892789
}
27902790

2791+
public function getSupportForObject(): bool
2792+
{
2793+
return false;
2794+
}
2795+
27912796
/**
27922797
* Get current attribute count from collection document
27932798
*

tests/unit/Validator/IndexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public function testGinIndexValidation(): void
274274
]);
275275

276276
// Validator with objectIndexSupport enabled
277-
$validator = new Index($collection->getAttribute('attributes'), 768, [], false, false, false, false, true);
277+
$validator = new Index($collection->getAttribute('attributes'), $collection->getAttribute('indexes', []), 768, [], false, false, false, false, true);
278278

279279
// Valid: GIN index on single TYPE_OBJECT attribute
280280
$validIndex = new Document([
@@ -320,7 +320,7 @@ public function testGinIndexValidation(): void
320320
$this->assertStringContainsString('GIN indexes do not support explicit orders', $validator->getDescription());
321321

322322
// Validator with objectIndexSupport disabled should reject GIN
323-
$validatorNoSupport = new Index($collection->getAttribute('attributes'), 768, [], false, false, false, false, false);
323+
$validatorNoSupport = new Index($collection->getAttribute('attributes'), $collection->getAttribute('indexes', []), 768, [], false, false, false, false, false);
324324
$this->assertFalse($validatorNoSupport->isValid($validIndex));
325325
$this->assertEquals('GIN indexes are not supported', $validatorNoSupport->getDescription());
326326
}

0 commit comments

Comments
 (0)