Skip to content

Commit d7ac7b0

Browse files
committed
Adding some extra tests
1 parent 249a6ce commit d7ac7b0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/ConnectionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,10 @@ public function testQueryLog()
8181
$this->assertEquals(5, count(DB::getQueryLog()));
8282
}
8383

84+
public function testSchemaBuilder()
85+
{
86+
$schema = DB::connection('mongodb')->getSchemaBuilder();
87+
$this->assertInstanceOf('Jenssegers\Mongodb\Schema\Builder', $schema);
88+
}
89+
8490
}

tests/SchemaTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function testCreate()
1616
{
1717
Schema::create('newcollection');
1818
$this->assertTrue(Schema::hasCollection('newcollection'));
19+
$this->assertTrue(Schema::hasTable('newcollection'));
1920
}
2021

2122
public function testDrop()
@@ -25,6 +26,21 @@ public function testDrop()
2526
$this->assertFalse(Schema::hasCollection('newcollection'));
2627
}
2728

29+
public function testBluePrint()
30+
{
31+
$instance = $this;
32+
33+
Schema::collection('newcollection', function($collection) use ($instance)
34+
{
35+
$instance->assertInstanceOf('Jenssegers\Mongodb\Schema\Blueprint', $collection);
36+
});
37+
38+
Schema::table('newcollection', function($collection) use ($instance)
39+
{
40+
$instance->assertInstanceOf('Jenssegers\Mongodb\Schema\Blueprint', $collection);
41+
});
42+
}
43+
2844
public function testIndex()
2945
{
3046
Schema::collection('newcollection', function($collection)

0 commit comments

Comments
 (0)