Skip to content

Commit

Permalink
Adding test for schemaCollection() as a setter
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Sep 29, 2014
1 parent ca1103b commit c205e7c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/TestCase/Database/ConnectionTest.php
Expand Up @@ -812,4 +812,25 @@ public function testTransactionalWithException() {
});
}

/**
* Tests it is possible to set a schema collection object
*
* @return void
*/
public function testSchemaCollection() {
$driver = $this->getMockFormDriver();
$connection = $this->getMock(
'\Cake\Database\Connection',
['connect'],
[['driver' => $driver]]
);

$schema = $connection->schemaCollection();
$this->assertInstanceOf('Cake\Database\Schema\Collection', $schema);

$schema = $this->getMock('Cake\Database\Schema\Collection', [], [$connection]);
$connection->schemaCollection($schema);
$this->assertSame($schema, $connection->schemaCollection());
}

}

0 comments on commit c205e7c

Please sign in to comment.