Skip to content

Commit 14cb9dc

Browse files
committed
Fix usage of config() in database, orm, view tests.
1 parent 253f47a commit 14cb9dc

15 files changed

+33
-33
lines changed

tests/TestCase/Database/Driver/MysqlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class MysqlTest extends TestCase
3232
public function setup()
3333
{
3434
parent::setUp();
35-
$config = ConnectionManager::config('test');
35+
$config = ConnectionManager::getConfig('test');
3636
$this->skipIf(strpos($config['driver'], 'Mysql') === false, 'Not using Mysql for test config');
3737
}
3838

tests/TestCase/Database/Schema/MysqlSchemaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MysqlSchemaTest extends TestCase
3535
*/
3636
protected function _needsConnection()
3737
{
38-
$config = ConnectionManager::config('test');
38+
$config = ConnectionManager::getConfig('test');
3939
$this->skipIf(strpos($config['driver'], 'Mysql') === false, 'Not using Mysql for test config');
4040
}
4141

tests/TestCase/Database/Schema/PostgresSchemaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PostgresSchemaTest extends TestCase
3535
*/
3636
protected function _needsConnection()
3737
{
38-
$config = ConnectionManager::config('test');
38+
$config = ConnectionManager::getConfig('test');
3939
$this->skipIf(strpos($config['driver'], 'Postgres') === false, 'Not using Postgres for test config');
4040
}
4141

tests/TestCase/Database/Schema/SqliteSchemaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SqliteSchemaTest extends TestCase
3535
*/
3636
protected function _needsConnection()
3737
{
38-
$config = ConnectionManager::config('test');
38+
$config = ConnectionManager::getConfig('test');
3939
$this->skipIf(strpos($config['driver'], 'Sqlite') === false, 'Not using Sqlite for test config');
4040
}
4141

tests/TestCase/Database/Schema/SqlserverSchemaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SqlserverSchemaTest extends TestCase
3434
*/
3535
protected function _needsConnection()
3636
{
37-
$config = ConnectionManager::config('test');
37+
$config = ConnectionManager::getConfig('test');
3838
$this->skipIf(strpos($config['driver'], 'Sqlserver') === false, 'Not using Sqlserver for test config');
3939
}
4040

tests/TestCase/ORM/Association/BelongsToManyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function testJunctionConnection()
189189
->setMethods(['setDriver'])
190190
->setConstructorArgs(['name' => 'other_source'])
191191
->getMock();
192-
ConnectionManager::config('other_source', $mock);
192+
ConnectionManager::setConfig('other_source', $mock);
193193
$this->article->connection(ConnectionManager::get('other_source'));
194194

195195
$assoc = new BelongsToMany('Test', [

tests/TestCase/ORM/Behavior/TreeBehaviorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ public function testRecover()
667667
->order('lft')
668668
->toArray();
669669
$table->updateAll(['lft' => null, 'rght' => null, 'depth' => null], []);
670-
$table->behaviors()->Tree->config('level', 'depth');
670+
$table->behaviors()->Tree->setConfig('level', 'depth');
671671
$table->recover();
672672

673673
$expected = [
@@ -1223,7 +1223,7 @@ public function testDeleteSubTreeScopedTree()
12231223
];
12241224
$this->assertMpttValues($expected, $table);
12251225

1226-
$table->behaviors()->get('Tree')->config('scope', ['menu' => 'categories']);
1226+
$table->behaviors()->get('Tree')->setConfig('scope', ['menu' => 'categories']);
12271227
$expected = [
12281228
' 1:10 - 9:electronics',
12291229
'_ 2: 9 - 10:televisions',
@@ -1418,7 +1418,7 @@ public function testGetLevel()
14181418
*/
14191419
public function testSetLevelNewNode()
14201420
{
1421-
$this->table->behaviors()->Tree->config('level', 'depth');
1421+
$this->table->behaviors()->Tree->setConfig('level', 'depth');
14221422

14231423
$entity = new Entity(['parent_id' => null, 'name' => 'Depth 0']);
14241424
$this->table->save($entity);
@@ -1443,7 +1443,7 @@ public function testSetLevelNewNode()
14431443
*/
14441444
public function testSetLevelExistingNode()
14451445
{
1446-
$this->table->behaviors()->Tree->config('level', 'depth');
1446+
$this->table->behaviors()->Tree->setConfig('level', 'depth');
14471447

14481448
// Leaf node
14491449
$entity = $this->table->get(4);

tests/TestCase/ORM/BehaviorRegistryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testLoad()
6262
$config = ['alias' => 'Sluggable', 'replacement' => '-'];
6363
$result = $this->Behaviors->load('Sluggable', $config);
6464
$this->assertInstanceOf('TestApp\Model\Behavior\SluggableBehavior', $result);
65-
$this->assertEquals($config, $result->config());
65+
$this->assertEquals($config, $result->getConfig());
6666

6767
$result = $this->Behaviors->load('TestPlugin.PersisterOne');
6868
$this->assertInstanceOf('TestPlugin\Model\Behavior\PersisterOneBehavior', $result);

tests/TestCase/ORM/BehaviorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function testConstructor()
193193
$table = $this->getMockBuilder('Cake\ORM\Table')->getMock();
194194
$config = ['key' => 'value'];
195195
$behavior = new TestBehavior($table, $config);
196-
$this->assertEquals($config, $behavior->config());
196+
$this->assertEquals($config, $behavior->getConfig());
197197
}
198198

199199
/**

tests/TestCase/ORM/TableTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,7 +2586,7 @@ public function testSaveNewErrorOnNoPrimaryKey()
25862586
*/
25872587
public function testAtomicSave()
25882588
{
2589-
$config = ConnectionManager::config('test');
2589+
$config = ConnectionManager::getConfig('test');
25902590

25912591
$connection = $this->getMockBuilder('\Cake\Database\Connection')
25922592
->setMethods(['begin', 'commit', 'inTransaction'])
@@ -2623,7 +2623,7 @@ public function testAtomicSaveRollback()
26232623
{
26242624
$connection = $this->getMockBuilder('\Cake\Database\Connection')
26252625
->setMethods(['begin', 'rollback'])
2626-
->setConstructorArgs([ConnectionManager::config('test')])
2626+
->setConstructorArgs([ConnectionManager::getConfig('test')])
26272627
->getMock();
26282628
$connection->setDriver(ConnectionManager::get('test')->getDriver());
26292629
$table = $this->getMockBuilder('\Cake\ORM\Table')
@@ -2663,7 +2663,7 @@ public function testAtomicSaveRollbackOnFailure()
26632663
{
26642664
$connection = $this->getMockBuilder('\Cake\Database\Connection')
26652665
->setMethods(['begin', 'rollback'])
2666-
->setConstructorArgs([ConnectionManager::config('test')])
2666+
->setConstructorArgs([ConnectionManager::getConfig('test')])
26672667
->getMock();
26682668
$connection->setDriver(ConnectionManager::get('test')->getDriver());
26692669
$table = $this->getMockBuilder('\Cake\ORM\Table')

0 commit comments

Comments
 (0)