Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 f57977d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/Cake/Test/TestCase/ORM/QueryTest.php
Expand Up @@ -18,6 +18,7 @@

use Cake\Core\Configure;
use Cake\Database\Connection;
use Cake\Model\ConnectionManager;
use Cake\ORM\Query;
use Cake\ORM\Table;

Expand All @@ -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'],
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/Test/TestCase/ORM/TableTest.php
Expand Up @@ -18,6 +18,7 @@

use Cake\Core\Configure;
use Cake\Database\Connection;
use Cake\Model\ConnectionManager;
use Cake\ORM\Table;

/**
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/TestSuite/Fixture/TestFixture.php
Expand Up @@ -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
Expand Down

0 comments on commit f57977d

Please sign in to comment.