Browse Source

change test class to simulate core's config usage

it doesn't have to - but it's probably a good idea not to leave
"settings" suggestions in the core
AD7six 12 years ago
parent
commit
75b0f45fef

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

@@ -167,7 +167,7 @@ class ConnectionManagerTest extends TestCase {
 
 		$this->assertInstanceOf('TestPlugin\Datasource\TestSource', $connection);
 		unset($config['className']);
-		$this->assertSame($config + ['name' => 'test_variant'], $connection->settings);
+		$this->assertSame($config + ['name' => 'test_variant'], $connection->config());
 	}
 
 /**

+ 23 - 0
tests/test_app/Plugin/TestPlugin/Datasource/TestSource.php

@@ -4,4 +4,27 @@ namespace TestPlugin\Datasource;
 
 class TestSource {
 
+/**
+ * Config
+ *
+ * @var array
+ */
+	protected $_config;
+
+/**
+ * Constructor
+ */
+	public function __construct(array $config) {
+		$this->_config = $config;
+	}
+
+/**
+ * config
+ *
+ * @return array
+ */
+	public function config() {
+		return $this->_config;
+	}
+
 }