1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Files
archived-php-src/ext/pdo/tests/pdo_quote_empty_string.phpt
George Peter Banyard a5cf82802d Make various failure conditions in PDO unconditional errors
This includes TypeErrors, ValueErrors, Error for uninitialized objects
and invalid user classes/callable instanciation

Closes GH-6212
2020-09-28 18:51:36 +01:00

32 lines
754 B
PHP

--TEST--
PDO::quote() must accept empty string for drivers which support this feature
--SKIPIF--
<?php
if (!extension_loaded('pdo')) die('skip');
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/');
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$pdo = PDOTest::factory();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
try {
$result = $pdo->quote('');
if (!is_string($result)) {
var_dump($result);
}
} catch (\PDOException) {
// Do nothing as quoting is not supported with this driver
}
?>
DONE
--EXPECT--
DONE