]> granicus.if.org Git - php/commitdiff
create temporary db in the current dir and cleanup on completion
authorAntony Dovgal <tony2001@php.net>
Mon, 5 Jan 2009 16:02:04 +0000 (16:02 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 5 Jan 2009 16:02:04 +0000 (16:02 +0000)
ext/pdo/tests/bug_44159.phpt

index d78b12fb9151c4b88caa128ef9fc920b7cf184e9..9f1961c267e1e98cd8518e99b278c49a903e64f3 100644 (file)
@@ -4,14 +4,14 @@ Bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL))
 <?php # vim:ft=php
 if (!extension_loaded('pdo')) die('skip PDO not available');
 try {
-       $pdo = new PDO("sqlite:/tmp/foo.db");
+       $pdo = new PDO("sqlite:".__DIR__."/foo.db");
 } catch (Exception $e) {
        die("skip PDP_SQLITE not available");
 }
 ?>
 --FILE--
 <?php
-$pdo = new PDO("sqlite:/tmp/foo.db");
+$pdo = new PDO("sqlite:".__DIR__."/foo.db");
 
 $attrs = array(PDO::ATTR_STATEMENT_CLASS, PDO::ATTR_STRINGIFY_FETCHES, PDO::NULL_TO_STRING);
 
@@ -21,6 +21,8 @@ foreach ($attrs as $attr) {
        var_dump($pdo->setAttribute($attr, 'nonsense'));
 }
 
+@unlink(__DIR__."/foo.db");
+
 ?>
 --EXPECTF--
 Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d