Skip to content
Permalink
Browse files

Reusing the connection with ConnectionManager to avoid failing tests

with Sqlite and :memory:
  • Loading branch information...
lorenzo committed Jun 16, 2013
1 parent a08755e commit f57977dbf942b17ff28ba3339eea5e67c6068470
@@ -18,6 +18,7 @@
use Cake\Core\Configure;
use Cake\Database\Connection;
use Cake\Model\ConnectionManager;
use Cake\ORM\Query;
use Cake\ORM\Table;
@@ -32,7 +33,7 @@ class QueryTest extends \Cake\TestSuite\TestCase {
public function setUp() {
parent::setUp();
$this->connection = new Connection(Configure::read('Datasource.test'));
$this->connection = ConnectionManager::getDataSource('test');
$schema = ['id' => ['type' => 'integer']];
$schema1 = [
'id' => ['type' => 'integer'],
@@ -18,6 +18,7 @@
use Cake\Core\Configure;
use Cake\Database\Connection;
use Cake\Model\ConnectionManager;
use Cake\ORM\Table;
/**
@@ -58,7 +59,7 @@ class TableTest extends \Cake\TestSuite\TestCase {
public function setUp() {
parent::setUp();
$this->connection = new Connection(Configure::read('Datasource.test'));
$this->connection = ConnectionManager::getDataSource('test');
}
public function tearDown() {
@@ -56,7 +56,7 @@ class TestFixture {
* Fields / Schema for the fixture.
*
* This array should be compatible with Cake\Database\Schema\Table.
* The `_constraints`, `_options` and `_indexes` keys are reserved for defining
* The `_constraints`, `_options` and `_indexes` keys are reserved for defining
* constraints, options and indexes respectively.
*
* @var array

0 comments on commit f57977d

Please sign in to comment.
You can’t perform that action at this time.