Skip to content

Commit 4cc9d5e

Browse files
committed
Use limit methods in tests
1 parent d42d8a2 commit 4cc9d5e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/Database/Base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ public function testExceptionAttributeLimit()
12681268
if (static::getAdapterName() === 'mariadb' || static::getAdapterName() === 'mysql') {
12691269
// load the collection up to the limit
12701270
$attributes = [];
1271-
for ($i=0; $i < 1012; $i++) {
1271+
for ($i=0; $i < $this->getDatabase()->getAttributeLimit(); $i++) {
12721272
$attributes[] = new Document([
12731273
'$id' => "test{$i}",
12741274
'type' => Database::VAR_INTEGER,
@@ -1459,7 +1459,7 @@ public function testExceptionIndexLimit()
14591459
// MariaDB, MySQL, and MongoDB create 3 indexes per new collection
14601460
// MongoDB create 4 indexes per new collection
14611461
// Add up to the limit, then check if the next index throws IndexLimitException
1462-
for ($i=0; $i < (64 - static::getUsedIndexes()); $i++) {
1462+
for ($i=0; $i < ($this->getDatabase()->getIndexLimit()); $i++) {
14631463
$this->assertEquals(true, static::getDatabase()->createIndex('indexLimit', "index{$i}", Database::INDEX_KEY, ["test{$i}"], [16]));
14641464
}
14651465
$this->expectException(LimitException::class);

0 commit comments

Comments
 (0)