diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc index 3a7d578e97713..9aee7126b3eb3 100644 --- a/ext/mysqli/tests/connect.inc +++ b/ext/mysqli/tests/connect.inc @@ -20,9 +20,6 @@ ini_set('mysqli.default_socket', $socket); } - /* Development setting: test experimental features and/or feature requests that never worked before? */ - $TEST_EXPERIMENTAL = 1 == getenv("MYSQL_TEST_EXPERIMENTAL"); - function get_environment_connection_flags(): int { static $connect_flags = null; if ($connect_flags === null) { diff --git a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt index 5b79f7a197d9a..1a2a6c9718dc0 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt @@ -130,13 +130,10 @@ require_once 'skipifconnectfailure.inc'; $mode = mt_rand(-1000, 1000); } while (in_array($mode, $valid)); - if ($TEST_EXPERIMENTAL) { - ob_start(); + try { new mysqli_result($link, $mode); - $content = ob_get_contents(); - ob_end_clean(); - if (!stristr($content, 'Invalid value for resultmode')) - printf("[009] Expecting warning because of invalid resultmode\n"); + } catch (ValueError $ex) { + echo $ex->getMessage(), "\n"; } print "done!"; @@ -169,4 +166,5 @@ mysqli_result->unknown = '' Constructor: mysqli_result object is already closed +mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT done! diff --git a/ext/mysqli/tests/mysqli_get_warnings.phpt b/ext/mysqli/tests/mysqli_get_warnings.phpt deleted file mode 100644 index 55db12d966a92..0000000000000 --- a/ext/mysqli/tests/mysqli_get_warnings.phpt +++ /dev/null @@ -1,141 +0,0 @@ ---TEST-- -mysqli_get_warnings() - TODO ---EXTENSIONS-- -mysqli ---SKIPIF-- - ---FILE-- -message)) || ('' == $warning->message)) /* NULL or not there at all */ - printf("[011] Expecting string/not empty, got %s/%s\n", gettype($warning->message), $warning->message); - - if ((!is_string($warning->sqlstate)) || ('' == $warning->sqlstate)) /* NULL or not there at all */ - printf("[012] Expecting string/not empty, got %s/%s\n", gettype($warning->sqlstate), $warning->sqlstate); - - if ((!is_int($warning->errno)) || (0 == $warning->errno)) /* NULL or not there at all */ - printf("[013] Expecting int/not 0, got %s/%s\n", gettype($warning->errno), $warning->errno); - - if (false !== ($tmp = $warning->next())) - printf("[014] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - - if (!mysqli_query($link, "INSERT INTO test (id) VALUES (1000000), (1000001)")) - printf("[015] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - if (($tmp = mysqli_warning_count($link)) !== 2) - printf("[016] Expecting 2 warnings, got %d warnings", $tmp); - - if (!is_object($warning = mysqli_get_warnings($link)) || 'mysqli_warning' != get_class($warning)) { - printf("[017] Expecting object/mysqli_warning, got %s/%s\n", gettype($tmp), (is_object($tmp) ? var_export($tmp, true) : $tmp)); - } - - if (true !== ($tmp = $warning->next())) - printf("[018] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); - - if (false !== ($tmp = $warning->next())) - printf("[020] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - - mysqli_close($link); - - - $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); - - if (!$mysqli->query("DROP TABLE IF EXISTS t1")) - printf("[022] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - if (!$mysqli->query("CREATE TABLE t1 (a smallint)")) - printf("[023] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - $warning = new mysqli_warning($mysqli); - - if (!is_string($warning->message) || ('' == $warning->message)) - printf("[025] Expecting string, got %s/%s", gettype($warning->message), $warning->message); - - if (!$mysqli->query("DROP TABLE t1")) - printf("[026] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - /* Yes, I really want to check if the object property is empty */ - $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); - - $warning = new mysqli_warning($mysqli); - if (false !== ($tmp = $warning->next())) - printf("[028] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - - if ('' != ($tmp = $warning->message)) - printf("[029] Expecting string/empty, got %s/%s\n", gettype($tmp), $tmp); - - $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); - - if (!$mysqli->query("DROP TABLE IF EXISTS t1")) - printf("[031] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - if (!$mysqli->query("CREATE TABLE t1 (a smallint)")) - printf("[032] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - /* out of range, three warnings */ - if (!$mysqli->query("INSERT IGNORE INTO t1(a) VALUES (65536), (65536), (65536)")) - printf("[033] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - - $warning = new mysqli_warning($mysqli); - $i = 1; - while ($warning->next() && ('' != ($tmp = $warning->message))) { - $i++; - } - if (3 != $i) - printf("[034] Expecting three warnings, got %d warnings\n", $i); - - $stmt = mysqli_stmt_init($mysqli); - $warning = new mysqli_warning($stmt); - if (false !== ($tmp = $warning->next())) - printf("[035] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - - print "done!"; -?> - ---EXPECT-- -done! diff --git a/ext/mysqli/tests/mysqli_warning_unclonable.phpt b/ext/mysqli/tests/mysqli_warning_unclonable.phpt index 7e404563f5df7..a9da213616144 100644 --- a/ext/mysqli/tests/mysqli_warning_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_warning_unclonable.phpt @@ -5,8 +5,6 @@ mysqli --SKIPIF-- --FILE-- --EXPECTF-- -Fatal error: Trying to clone an uncloneable object of class mysqli_warning in %s on line %d +Fatal error: Uncaught Error: Trying to clone an uncloneable object of class mysqli_warning in %s:%d +Stack trace:%A diff --git a/ext/mysqli/tests/test_setup/test_helpers.inc b/ext/mysqli/tests/test_setup/test_helpers.inc index 7c75034006864..5e6833a3253b9 100644 --- a/ext/mysqli/tests/test_setup/test_helpers.inc +++ b/ext/mysqli/tests/test_setup/test_helpers.inc @@ -142,6 +142,4 @@ function setup_table_with_data_on_default_connection(string $table): mysqli { return $link; } -/* Development setting: test experimental features and/or feature requests that never worked before? */ -//$TEST_EXPERIMENTAL = 1 == getenv("MYSQL_TEST_EXPERIMENTAL"); //$engine = getenv("MYSQL_TEST_ENGINE") ?: "InnoDB";