diff options
| author | Dharman <tekiela246@gmail.com> | 2021-03-05 22:26:55 +0000 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-15 11:01:12 +0100 |
| commit | 8573eb9e5cfc75d4aae290928a6b5b985b15166d (patch) | |
| tree | 7a4a39d21413fbb72c953eb184b846f7f76b4d69 /ext/mysqli | |
| parent | 3b9ea4d2893602386a7f900ae2ababfd9c58ce47 (diff) | |
| download | php-git-8573eb9e5cfc75d4aae290928a6b5b985b15166d.tar.gz | |
Add CLEAN sections to mysqli and PDO mysql tests
Closes GH-6756.
Diffstat (limited to 'ext/mysqli')
| -rw-r--r-- | ext/mysqli/tests/bug66124.phpt | 14 | ||||
| -rw-r--r-- | ext/mysqli/tests/bug75018.phpt | 6 | ||||
| -rw-r--r-- | ext/mysqli/tests/bug77597.phpt | 12 | ||||
| -rw-r--r-- | ext/mysqli/tests/bug77935.phpt | 7 | ||||
| -rw-r--r-- | ext/mysqli/tests/connect.inc | 4 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_insert_packet_overflow.phpt | 7 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_query_unicode.phpt | 8 | ||||
| -rw-r--r-- | ext/mysqli/tests/mysqli_stmt_multires.phpt | 8 | ||||
| -rw-r--r-- | ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt | 7 |
9 files changed, 57 insertions, 16 deletions
diff --git a/ext/mysqli/tests/bug66124.phpt b/ext/mysqli/tests/bug66124.phpt index cede635e14..8a2e5a5f73 100644 --- a/ext/mysqli/tests/bug66124.phpt +++ b/ext/mysqli/tests/bug66124.phpt @@ -8,15 +8,15 @@ require_once('skipifconnectfailure.inc'); ?> --FILE-- <?php -$table_drop = "DROP TABLE IF EXISTS `bug66124`"; -$table_create = "CREATE TABLE `bug66124` ( +$table_drop = "DROP TABLE IF EXISTS `test`"; +$table_create = "CREATE TABLE `test` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8"; -$table_insert = "INSERT INTO `bug66124` SET `id`=?"; -$table_select = "SELECT * FROM `bug66124`"; -$table_delete = "DELETE FROM `bug66124`"; +$table_insert = "INSERT INTO `test` SET `id`=?"; +$table_select = "SELECT * FROM `test`"; +$table_delete = "DELETE FROM `test`"; $id = '1311200011005001566'; @@ -91,6 +91,10 @@ if ($result){ $link->close(); ?> done +--CLEAN-- +<?php +require_once "clean_table.inc"; +?> --EXPECT-- Using 'i': insert id:1311200011005001566=>1311200011005001566 diff --git a/ext/mysqli/tests/bug75018.phpt b/ext/mysqli/tests/bug75018.phpt index 28af0bb77c..ce522aab87 100644 --- a/ext/mysqli/tests/bug75018.phpt +++ b/ext/mysqli/tests/bug75018.phpt @@ -11,7 +11,7 @@ require_once("connect.inc"); $mysqli = new mysqli("$host:$port", $user, $passwd, $db); -$tbl = "test_bug75018"; +$tbl = "test"; $sql = "DROP TABLE IF EXISTS $tbl"; $mysqli->query($sql); @@ -31,6 +31,10 @@ while ($row = $result->fetch_assoc()) { } ?> +--CLEAN-- +<?php +require_once "clean_table.inc"; +?> --EXPECT-- string(1) "0" string(4) "1365" diff --git a/ext/mysqli/tests/bug77597.phpt b/ext/mysqli/tests/bug77597.phpt index 52ae874454..cd9055deb7 100644 --- a/ext/mysqli/tests/bug77597.phpt +++ b/ext/mysqli/tests/bug77597.phpt @@ -12,11 +12,11 @@ if (!defined('MYSQLI_STORE_RESULT_COPY_DATA')) die('skip requires mysqlnd'); require_once("connect.inc"); $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); -$mysqli->query('DROP TABLE IF EXISTS a'); -$mysqli->query('CREATE TABLE a (b int)'); -$mysqli->query('INSERT INTO a VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9)'); +$mysqli->query('DROP TABLE IF EXISTS test'); +$mysqli->query('CREATE TABLE test (b int)'); +$mysqli->query('INSERT INTO test VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9)'); -$mysqli->real_query("SELECT * FROM a"); +$mysqli->real_query("SELECT * FROM test"); $result = $mysqli->store_result(MYSQLI_STORE_RESULT_COPY_DATA); @@ -24,5 +24,9 @@ $field = $result->fetch_field(); var_dump($field->name); ?> +--CLEAN-- +<?php +require_once "clean_table.inc"; +?> --EXPECT-- string(1) "b" diff --git a/ext/mysqli/tests/bug77935.phpt b/ext/mysqli/tests/bug77935.phpt index 7a39ac0065..9917488a25 100644 --- a/ext/mysqli/tests/bug77935.phpt +++ b/ext/mysqli/tests/bug77935.phpt @@ -31,6 +31,13 @@ while ($row = $result->fetch_assoc()) { } ?> +--CLEAN-- +<?php +require_once 'connect.inc'; +$link = new mysqli($host, $user, $passwd, $db, $port, $socket); +$link->query('DROP PROCEDURE IF EXISTS testSp'); +$link->close(); +?> --EXPECT-- array(1) { [1]=> diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc index 604ecc97ea..0fb3cff66c 100644 --- a/ext/mysqli/tests/connect.inc +++ b/ext/mysqli/tests/connect.inc @@ -51,7 +51,7 @@ if (!function_exists('my_mysqli_connect')) { /** - * Whenever possible, please use this wrapper to make testing ot MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible + * Whenever possible, please use this wrapper to make testing of MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible * * @param enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS)? */ @@ -71,7 +71,7 @@ } /** - * Whenever possible, please use this wrapper to make testing ot MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible + * Whenever possible, please use this wrapper to make testing of MYSQLI_CLIENT_COMPRESS (and potentially SSL) possible * * @param enable_env_flags Enable setting of connection flags through env(MYSQL_TEST_CONNECT_FLAGS) */ diff --git a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt index 105b3276d3..1285fe1f50 100644 --- a/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt +++ b/ext/mysqli/tests/mysqli_insert_packet_overflow.phpt @@ -113,5 +113,12 @@ memory_limit=256M print "done!"; ?> +--CLEAN-- +<?php +require_once 'connect.inc'; +$link = new mysqli($host, $user, $passwd, $db, $port, $socket); +$link->query('DROP TABLE test__mysqli_insert_packet_overflow'); +$link->close(); +?> --EXPECT-- done! diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt index b62418508f..6a5e1be912 100644 --- a/ext/mysqli/tests/mysqli_query_unicode.phpt +++ b/ext/mysqli/tests/mysqli_query_unicode.phpt @@ -82,6 +82,14 @@ mysqli_close($link); print "done!"; ?> +--CLEAN-- +<?php +require_once 'connect.inc'; +$link = new mysqli($host, $user, $passwd, $db, $port, $socket); +$link->query('DROP PROCEDURE IF EXISTS процедурка'); +$link->query('DROP FUNCTION IF EXISTS функцийка'); +$link->close(); +?> --EXPECTF-- array(1) { ["правилен"]=> diff --git a/ext/mysqli/tests/mysqli_stmt_multires.phpt b/ext/mysqli/tests/mysqli_stmt_multires.phpt index 73af79e2b1..07abac4dcc 100644 --- a/ext/mysqli/tests/mysqli_stmt_multires.phpt +++ b/ext/mysqli/tests/mysqli_stmt_multires.phpt @@ -94,10 +94,10 @@ require_once('skipifconnectfailure.inc'); ?> --CLEAN-- <?php - require_once("connect.inc"); - if (!$link->query('DROP PROCEDURE IF EXISTS p123')) { - printf("[001] [%d] %s\n", $link->error, $link->errno); - } +require_once 'connect.inc'; +$link = new mysqli($host, $user, $passwd, $db, $port, $socket); +$link->query('DROP PROCEDURE IF EXISTS p123'); +$link->close(); ?> --EXPECT-- string(4) "pre:" diff --git a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt index ed15d10e4a..c4d80498b1 100644 --- a/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt +++ b/ext/mysqli/tests/ps_cursor_multiple_result_sets.phpt @@ -71,6 +71,13 @@ while ($row = $result->fetch_assoc()) { $stmt->next_result(); ?> +--CLEAN-- +<?php +require_once 'connect.inc'; +$link = new mysqli($host, $user, $passwd, $db, $port, $socket); +$link->query('DROP PROCEDURE IF EXISTS testPs'); +$link->close(); +?> --EXPECT-- use_result: int(1) |
