]> 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:01:45 +0000 (16:01 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 5 Jan 2009 16:01:45 +0000 (16:01 +0000)
ext/pdo/tests/bug_44159.phpt

index db4da4013951d140b430c28f7ad76d7123273808..6c7415ae0b29f41654179976609ea036bff603ef 100644 (file)
@@ -7,7 +7,8 @@ if (!extension_loaded('pdo_sqlite')) die('skip no pdo_sqlite');
 --FILE--
 <?php
 
-$pdo = new PDO("sqlite:/tmp/foo.db");
+$dir = dirname(__FILE__);
+$pdo = new PDO("sqlite:$dir/foo.db");
 
 $attrs = array(PDO::ATTR_STATEMENT_CLASS, PDO::ATTR_STRINGIFY_FETCHES, PDO::NULL_TO_STRING);
 
@@ -17,6 +18,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