Skip to content

Commit

Permalink
Use managed connections instead of creating new ones.
Browse files Browse the repository at this point in the history
This fixes missing tables in Sqlite with memory databases, and solves
issues where default installs of postgres complain about maximum
connections.
  • Loading branch information
markstory committed Jun 17, 2013
1 parent 39ab809 commit 9f1eb9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Test/TestCase/ORM/QueryTest.php
Expand Up @@ -17,7 +17,7 @@
namespace Cake\Test\TestCase\ORM;

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

Expand All @@ -32,7 +32,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
4 changes: 2 additions & 2 deletions lib/Cake/Test/TestCase/ORM/TableTest.php
Expand Up @@ -17,7 +17,7 @@
namespace Cake\Test\TestCase\ORM;

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

/**
Expand Down Expand Up @@ -58,7 +58,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

0 comments on commit 9f1eb9c

Please sign in to comment.