Browse Source

3 slashes are required for :memory:

otherwise it's misunderstood to be an unconventional hostname
AD7six 11 years ago
parent
commit
b5059dd4c8
4 changed files with 6 additions and 6 deletions
  1. 2 2
      .travis.yml
  2. 1 1
      phpunit.xml.dist
  3. 2 2
      tests/TestCase/Core/StaticConfigTraitTest.php
  4. 1 1
      tests/bootstrap.php

+ 2 - 2
.travis.yml

@@ -8,7 +8,7 @@ php:
 env:
   - DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'
   - DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
-  - DB=sqlite db_dsn='sqlite://:memory:'
+  - DB=sqlite db_dsn='sqlite:///:memory:'
 
 services:
   - memcached
@@ -21,7 +21,7 @@ matrix:
     - php: 5.4
       env: PHPCS=1
     - php: hhvm-nightly
-      env: HHVM=1 DB=sqlite db_dsn='sqlite://:memory:'
+      env: HHVM=1 DB=sqlite db_dsn='sqlite:///:memory:'
     - php: hhvm-nightly
       env: HHVM=1 DB=mysql db_dsn='mysql://travis@0.0.0.0/cakephp_test'
 

+ 1 - 1
phpunit.xml.dist

@@ -33,7 +33,7 @@
 	</listeners>
 	<php>
 		<!-- SQLite
-		<env name="db_dsn" value="sqlite://:memory:"/>
+		<env name="db_dsn" value="sqlite:///:memory:"/>
 		-->
 		<!-- Postgres
 		<env name="db_dsn" value="postgres://localhost/cake_test"/>

+ 2 - 2
tests/TestCase/Core/StaticConfigTraitTest.php

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

+ 1 - 1
tests/bootstrap.php

@@ -98,7 +98,7 @@ Cache::config([
 
 // Ensure default test connection is defined
 if (!getenv('db_dsn')) {
-	putenv('db_dsn=sqlite://:memory:');
+	putenv('db_dsn=sqlite:///:memory:');
 }
 
 ConnectionManager::config('test', ['url' => getenv('db_dsn')]);