mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
Fix intermittent error in pdo_mysql___construct_options.phpt
For the love of god, don't write tests based on mt_rand!
This commit is contained in:
parent
e760d94f4b
commit
8753975418
@ -76,9 +76,7 @@ MySQLPDOTest::skip();
|
||||
if (!is_object($db = new PDO($dsn, $user, $pass, array())))
|
||||
printf("[002] Expecting object got %s/%s¸\n", gettype($db), $db);
|
||||
|
||||
do {
|
||||
$invalid = mt_rand(-1000, 1000);
|
||||
} while (isset($valid_options[$invalid]));
|
||||
$invalid = 999;
|
||||
if (is_object($db = new PDO($dsn, $user, $pass, array($invalid => true))))
|
||||
printf("[003] [TODO][CHANGEREQUEST] Please, lets not ignore invalid options and bail out!\n");
|
||||
|
||||
|
@ -15,13 +15,6 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
|
||||
$db = MySQLPDOTest::factory();
|
||||
MySQLPDOTest::createTestTable($db, MySQLPDOTest::detect_transactional_mysql_engine($db));
|
||||
|
||||
function find_invalid_int($valid_options) {
|
||||
do {
|
||||
$invalid = mt_rand(-10000, 10000);
|
||||
} while (in_array($invalid, $valid_options));
|
||||
return $invalid;
|
||||
}
|
||||
|
||||
function set_and_get($offset, $db, $attribute, $value) {
|
||||
|
||||
$value_type = gettype($value);
|
||||
|
Loading…
Reference in New Issue
Block a user