com php-src: Create temporary sqlite db in test dir rather than cwd (and clean it up): ext/pdo_sqlite/tests/bug70221.phpt
| From: | Sara Golemon | Date: | Sat, 30 Apr 2016 06:02:01 +0000 |
| Subject: | com php-src: Create temporary sqlite db in test dir rather than cwd (and clean it up): ext/pdo_sqlite/tests/bug70221.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91978@lists.php.net to get a copy of this message | ||
Commit: d0b952260e7c9794953268ccc34e1b3843b0be68
Author: Sara Golemon <pollita@php.net> Sat, 30 Apr 2016 06:02:01 +0000
Parents: 8c74f03c10568a98ca11e8567356314cb2f70ae1
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d0b952260e7c9794953268ccc34e1b3843b0be68
Log:
Create temporary sqlite db in test dir rather than cwd (and clean it up)
Well behaved tests do not leave their droppings all over the filesystem.
Changed paths:
M ext/pdo_sqlite/tests/bug70221.phpt
Diff:
diff --git a/ext/pdo_sqlite/tests/bug70221.phpt b/ext/pdo_sqlite/tests/bug70221.phpt
index 1ee2378..bead80d 100644
--- a/ext/pdo_sqlite/tests/bug70221.phpt
+++ b/ext/pdo_sqlite/tests/bug70221.phpt
@@ -6,10 +6,13 @@ if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
?>
--FILE--
<?php
-$db = new PDO('sqlite:test.sqlite', null, null, array(PDO::ATTR_PERSISTENT => true));
+$dbfile = __DIR__ . '/test.sqlite';
+$db = new PDO('sqlite:'.$dbfile, null, null, array(PDO::ATTR_PERSISTENT => true));
function _test() { return 42; }
$db->sqliteCreateFunction('test', '_test', 0);
print("Everything is fine, no exceptions here\n");
+unset($db);
+unlink($dbfile);
?>
--EXPECT--
Everything is fine, no exceptions here