This commit is contained in:
Felipe Pena 2008-02-19 14:53:04 +00:00
parent 083f474a47
commit eaed933e57

View File

@ -0,0 +1,32 @@
--TEST--
Bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL))
--FILE--
<?php
$pdo = new PDO("sqlite:/tmp/foo.db");
$attrs = array(PDO::ATTR_STATEMENT_CLASS, PDO::ATTR_STRINGIFY_FETCHES, PDO::NULL_TO_STRING);
foreach ($attrs as $attr) {
var_dump($pdo->setAttribute($attr, NULL));
var_dump($pdo->setAttribute($attr, 1));
var_dump($pdo->setAttribute($attr, 'nonsense'));
}
?>
--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
bool(false)
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
bool(false)
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
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)