浏览代码

add a test for using sqlite with an absolute path

the first forward slash is always present because of how url parsing
works. because it may be confusing, add a test for how to specify an
absolute path (requires an extra forward slash).
AD7six 11 年之前
父节点
当前提交
7c6cb2494e
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      tests/TestCase/Core/StaticConfigTraitTest.php

+ 9 - 0
tests/TestCase/Core/StaticConfigTraitTest.php

@@ -212,6 +212,15 @@ class StaticConfigTraitTest extends TestCase {
 		];
 		$this->assertEquals($expected, TestConnectionManagerStaticConfig::parseDsn($dsn));
 
+		$dsn = 'sqlite:////absolute/path';
+		$expected = [
+			'className' => 'Cake\Database\Connection',
+			'driver' => 'Cake\Database\Driver\Sqlite',
+			'database' => '/absolute/path',
+			'scheme' => 'sqlite',
+		];
+		$this->assertEquals($expected, TestConnectionManagerStaticConfig::parseDsn($dsn));
+
 		$dsn = 'sqlite:///?database=:memory:';
 		$expected = [
 			'className' => 'Cake\Database\Connection',