Commit d7ac7b07 authored by Jens Segers's avatar Jens Segers

Adding some extra tests

parent 249a6ce5
...@@ -81,4 +81,10 @@ class ConnectionTest extends PHPUnit_Framework_TestCase { ...@@ -81,4 +81,10 @@ class ConnectionTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(5, count(DB::getQueryLog())); $this->assertEquals(5, count(DB::getQueryLog()));
} }
public function testSchemaBuilder()
{
$schema = DB::connection('mongodb')->getSchemaBuilder();
$this->assertInstanceOf('Jenssegers\Mongodb\Schema\Builder', $schema);
}
} }
...@@ -16,6 +16,7 @@ class SchemaTest extends PHPUnit_Framework_TestCase { ...@@ -16,6 +16,7 @@ class SchemaTest extends PHPUnit_Framework_TestCase {
{ {
Schema::create('newcollection'); Schema::create('newcollection');
$this->assertTrue(Schema::hasCollection('newcollection')); $this->assertTrue(Schema::hasCollection('newcollection'));
$this->assertTrue(Schema::hasTable('newcollection'));
} }
public function testDrop() public function testDrop()
...@@ -25,6 +26,21 @@ class SchemaTest extends PHPUnit_Framework_TestCase { ...@@ -25,6 +26,21 @@ class SchemaTest extends PHPUnit_Framework_TestCase {
$this->assertFalse(Schema::hasCollection('newcollection')); $this->assertFalse(Schema::hasCollection('newcollection'));
} }
public function testBluePrint()
{
$instance = $this;
Schema::collection('newcollection', function($collection) use ($instance)
{
$instance->assertInstanceOf('Jenssegers\Mongodb\Schema\Blueprint', $collection);
});
Schema::table('newcollection', function($collection) use ($instance)
{
$instance->assertInstanceOf('Jenssegers\Mongodb\Schema\Blueprint', $collection);
});
}
public function testIndex() public function testIndex()
{ {
Schema::collection('newcollection', function($collection) Schema::collection('newcollection', function($collection)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment