Skip to content

Commit 61316c4

Browse files
committed
Add integration test for Schema::getConnectionCount()
1 parent 4b79aa0 commit 61316c4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Illuminate/Support/Facades/Schema.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
* @method static void mixin(object $mixin, bool $replace = true)
4646
* @method static bool hasMacro(string $name)
4747
* @method static void flushMacros()
48+
* @method static int|null getConnectionCount()
4849
*
4950
* @see \Illuminate\Database\Schema\Builder
5051
*/

tests/Integration/Database/SchemaBuilderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,4 +874,14 @@ public function testAddingMacros()
874874
$this->assertTrue(Schema::hasForeignKeyForColumn('question_id', 'answers', 'questions'));
875875
$this->assertFalse(Schema::hasForeignKeyForColumn('body', 'answers', 'questions'));
876876
}
877+
878+
public function testGetConnectionCount()
879+
{
880+
$count = Schema::getConnectionCount();
881+
if ($this->driver === 'sqlite') {
882+
$this->assertNull($count, 'SQLite does not support connection count');
883+
} else {
884+
$this->assertGreaterThanOrEqual(1, $count);
885+
}
886+
}
877887
}

0 commit comments

Comments
 (0)