|
@@ -26,6 +26,12 @@ class TestConnectionManagerStaticConfig {
|
|
|
parseDsn as protected _parseDsn;
|
|
parseDsn as protected _parseDsn;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Parse a DSN
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param string $config The config to parse.
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
public static function parseDsn($config = null) {
|
|
public static function parseDsn($config = null) {
|
|
|
$config = static::_parseDsn($config);
|
|
$config = static::_parseDsn($config);
|
|
|
|
|
|
|
@@ -42,6 +48,11 @@ class TestConnectionManagerStaticConfig {
|
|
|
return $config;
|
|
return $config;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Database driver class map.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
public static function getClassMap() {
|
|
public static function getClassMap() {
|
|
|
return [
|
|
return [
|
|
|
'mysql' => 'Cake\Database\Driver\Mysql',
|
|
'mysql' => 'Cake\Database\Driver\Mysql',
|
|
@@ -60,6 +71,11 @@ class TestCacheStaticConfig {
|
|
|
|
|
|
|
|
use StaticConfigTrait;
|
|
use StaticConfigTrait;
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Cache driver class map.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
public static function getClassMap() {
|
|
public static function getClassMap() {
|
|
|
return [
|
|
return [
|
|
|
'apc' => 'Cake\Cache\Engine\ApcEngine',
|
|
'apc' => 'Cake\Cache\Engine\ApcEngine',
|
|
@@ -81,6 +97,11 @@ class TestEmailStaticConfig {
|
|
|
|
|
|
|
|
use StaticConfigTrait;
|
|
use StaticConfigTrait;
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Email driver class map.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
public static function getClassMap() {
|
|
public static function getClassMap() {
|
|
|
return [
|
|
return [
|
|
|
'debug' => 'Cake\Network\Email\DebugTransport',
|
|
'debug' => 'Cake\Network\Email\DebugTransport',
|
|
@@ -98,6 +119,11 @@ class TestLogStaticConfig {
|
|
|
|
|
|
|
|
use StaticConfigTrait;
|
|
use StaticConfigTrait;
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Log engine class map.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
public static function getClassMap() {
|
|
public static function getClassMap() {
|
|
|
return [
|
|
return [
|
|
|
'console' => 'Cake\Log\Engine\ConsoleLog',
|
|
'console' => 'Cake\Log\Engine\ConsoleLog',
|
|
@@ -114,11 +140,21 @@ class TestLogStaticConfig {
|
|
|
*/
|
|
*/
|
|
|
class StaticConfigTraitTest extends TestCase {
|
|
class StaticConfigTraitTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * setup method
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ */
|
|
|
public function setUp() {
|
|
public function setUp() {
|
|
|
parent::setUp();
|
|
parent::setUp();
|
|
|
$this->subject = $this->getObjectForTrait('Cake\Core\StaticConfigTrait');
|
|
$this->subject = $this->getObjectForTrait('Cake\Core\StaticConfigTrait');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * teardown method
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ */
|
|
|
public function tearDown() {
|
|
public function tearDown() {
|
|
|
unset($this->subject);
|
|
unset($this->subject);
|
|
|
parent::tearDown();
|
|
parent::tearDown();
|
|
@@ -130,9 +166,8 @@ class StaticConfigTraitTest extends TestCase {
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testSimpleParseDsn() {
|
|
public function testSimpleParseDsn() {
|
|
|
- $klassName = get_class($this->subject);
|
|
|
|
|
-
|
|
|
|
|
- $this->assertSame([], $klassName::parseDsn(''));
|
|
|
|
|
|
|
+ $className = get_class($this->subject);
|
|
|
|
|
+ $this->assertSame([], $className::parseDsn(''));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -142,8 +177,8 @@ class StaticConfigTraitTest extends TestCase {
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testParseBadType() {
|
|
public function testParseBadType() {
|
|
|
- $klassName = get_class($this->subject);
|
|
|
|
|
- $klassName::parseDsn(['url' => 'http://:80']);
|
|
|
|
|
|
|
+ $className = get_class($this->subject);
|
|
|
|
|
+ $className::parseDsn(['url' => 'http://:80']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -385,4 +420,3 @@ class StaticConfigTraitTest extends TestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|