Browse Source

Fix more usage of config().

Mark Story 8 years ago
parent
commit
4548fc77e2

+ 14 - 14
tests/TestCase/Datasource/ConnectionManagerTest.php

@@ -99,7 +99,7 @@ class ConnectionManagerTest extends TestCase
     public function testConfigVariants($settings)
     {
         $this->assertNotContains('test_variant', ConnectionManager::configured(), 'test_variant config should not exist.');
-        ConnectionManager::config('test_variant', $settings);
+        ConnectionManager::setConfig('test_variant', $settings);
 
         $ds = ConnectionManager::get('test_variant');
         $this->assertInstanceOf(__NAMESPACE__ . '\FakeConnection', $ds);
@@ -113,7 +113,7 @@ class ConnectionManagerTest extends TestCase
      */
     public function testConfigInvalidOptions()
     {
-        ConnectionManager::config('test_variant', [
+        ConnectionManager::setConfig('test_variant', [
             'className' => 'Herp\Derp'
         ]);
         ConnectionManager::get('test_variant');
@@ -132,8 +132,8 @@ class ConnectionManagerTest extends TestCase
             'className' => __NAMESPACE__ . '\FakeConnection',
             'database' => ':memory:',
         ];
-        ConnectionManager::config('test_variant', $settings);
-        ConnectionManager::config('test_variant', $settings);
+        ConnectionManager::setConfig('test_variant', $settings);
+        ConnectionManager::setConfig('test_variant', $settings);
     }
 
     /**
@@ -155,7 +155,7 @@ class ConnectionManagerTest extends TestCase
      */
     public function testGet()
     {
-        $config = ConnectionManager::config('test');
+        $config = ConnectionManager::getConfig('test');
         $this->skipIf(empty($config), 'No test config, skipping');
 
         $ds = ConnectionManager::get('test');
@@ -173,7 +173,7 @@ class ConnectionManagerTest extends TestCase
      */
     public function testGetNoAlias()
     {
-        $config = ConnectionManager::config('test');
+        $config = ConnectionManager::getConfig('test');
         $this->skipIf(empty($config), 'No test config, skipping');
 
         ConnectionManager::alias('test', 'other_name');
@@ -187,7 +187,7 @@ class ConnectionManagerTest extends TestCase
      */
     public function testConfigured()
     {
-        ConnectionManager::config('test_variant', [
+        ConnectionManager::setConfig('test_variant', [
             'className' => __NAMESPACE__ . '\FakeConnection',
             'database' => ':memory:'
         ]);
@@ -205,7 +205,7 @@ class ConnectionManagerTest extends TestCase
         Plugin::load('TestPlugin');
         $name = 'test_variant';
         $config = ['className' => 'TestPlugin.TestSource', 'foo' => 'bar'];
-        ConnectionManager::config($name, $config);
+        ConnectionManager::setConfig($name, $config);
         $connection = ConnectionManager::get($name);
 
         $this->assertInstanceOf('TestPlugin\Datasource\TestSource', $connection);
@@ -220,7 +220,7 @@ class ConnectionManagerTest extends TestCase
      */
     public function testDrop()
     {
-        ConnectionManager::config('test_variant', [
+        ConnectionManager::setConfig('test_variant', [
             'className' => __NAMESPACE__ . '\FakeConnection',
             'database' => ':memory:'
         ]);
@@ -241,7 +241,7 @@ class ConnectionManagerTest extends TestCase
      */
     public function testAlias()
     {
-        ConnectionManager::config('test_variant', [
+        ConnectionManager::setConfig('test_variant', [
             'className' => __NAMESPACE__ . '\FakeConnection',
             'database' => ':memory:'
         ]);
@@ -466,7 +466,7 @@ class ConnectionManagerTest extends TestCase
     public function testConfigWithObject()
     {
         $connection = new FakeConnection;
-        ConnectionManager::config('test_variant', $connection);
+        ConnectionManager::setConfig('test_variant', $connection);
         $this->assertSame($connection, ConnectionManager::get('test_variant'));
     }
 
@@ -484,7 +484,7 @@ class ConnectionManagerTest extends TestCase
             return $connection;
         };
 
-        ConnectionManager::config('test_variant', $callable);
+        ConnectionManager::setConfig('test_variant', $callable);
         $this->assertSame($connection, ConnectionManager::get('test_variant'));
     }
 
@@ -496,7 +496,7 @@ class ConnectionManagerTest extends TestCase
     public function testSetConfigName()
     {
         //Set with explicit name
-        ConnectionManager::config('test_variant', [
+        ConnectionManager::setConfig('test_variant', [
             'className' => __NAMESPACE__ . '\FakeConnection',
             'database' => ':memory:'
         ]);
@@ -504,7 +504,7 @@ class ConnectionManagerTest extends TestCase
         $this->assertSame('test_variant', $result->configName());
 
         ConnectionManager::drop('test_variant');
-        ConnectionManager::config([
+        ConnectionManager::setConfig([
             'test_variant' => [
                 'className' => __NAMESPACE__ . '\FakeConnection',
                 'database' => ':memory:'

+ 2 - 2
tests/TestCase/Datasource/PaginatorTest.php

@@ -477,7 +477,7 @@ class PaginatorTest extends TestCase
             'limit' => 20,
             'maxLimit' => 100,
         ];
-        $this->Paginator->config('whitelist', ['fields']);
+        $this->Paginator->setConfig('whitelist', ['fields']);
         $defaults = $this->Paginator->getDefaults('Post', $settings);
         $result = $this->Paginator->mergeOptions($params, $defaults);
         $expected = [
@@ -1181,7 +1181,7 @@ class PaginatorTest extends TestCase
      */
     public function testPaginateQueryWithBindValue()
     {
-        $config = ConnectionManager::config('test');
+        $config = ConnectionManager::getConfig('test');
         $this->skipIf(strpos($config['driver'], 'Sqlserver') !== false, 'Test temporarily broken in SQLServer');
         $this->loadFixtures('Posts');
         $table = TableRegistry::get('PaginatorPosts');

+ 1 - 1
tests/TestCase/Datasource/QueryCacherTest.php

@@ -37,7 +37,7 @@ class QueryCacherTest extends TestCase
             ->method('init')
             ->will($this->returnValue(true));
 
-        Cache::config('queryCache', $this->engine);
+        Cache::setConfig('queryCache', $this->engine);
         Cache::enable();
     }
 

+ 2 - 2
tests/TestCase/Error/DebuggerTest.php

@@ -490,7 +490,7 @@ TEXT;
         $mock = $this->getMockBuilder('Cake\Log\Engine\BaseLog')
             ->setMethods(['log'])
             ->getMock();
-        Log::config('test', ['engine' => $mock]);
+        Log::setConfig('test', ['engine' => $mock]);
 
         $mock->expects($this->at(0))
             ->method('log')
@@ -524,7 +524,7 @@ TEXT;
         $mock = $this->getMockBuilder('Cake\Log\Engine\BaseLog')
             ->setMethods(['log'])
             ->getMock();
-        Log::config('test', ['engine' => $mock]);
+        Log::setConfig('test', ['engine' => $mock]);
 
         $mock->expects($this->at(0))
             ->method('log')

+ 1 - 1
tests/TestCase/Error/ErrorHandlerTest.php

@@ -95,7 +95,7 @@ class ErrorHandlerTest extends TestCase
         $this->_logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
 
         Log::reset();
-        Log::config('error_test', [
+        Log::setConfig('error_test', [
             'engine' => $this->_logger
         ]);
     }

+ 1 - 1
tests/TestCase/Error/Middleware/ErrorHandlerMiddlewareTest.php

@@ -42,7 +42,7 @@ class ErrorHandlerMiddlewareTest extends TestCase
         $this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
 
         Log::reset();
-        Log::config('error_test', [
+        Log::setConfig('error_test', [
             'engine' => $this->logger
         ]);
     }