mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
New test
This commit is contained in:
parent
083f474a47
commit
eaed933e57
32
ext/pdo/tests/bug_44159.phpt
Normal file
32
ext/pdo/tests/bug_44159.phpt
Normal 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)
|
||||
|
Loading…
Reference in New Issue
Block a user