summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/tests')
-rw-r--r--ext/mysqli/tests/001.phpt3
-rw-r--r--ext/mysqli/tests/014.phpt2
-rw-r--r--ext/mysqli/tests/017.phpt1
-rw-r--r--ext/mysqli/tests/033.phpt1
-rw-r--r--ext/mysqli/tests/034.phpt1
-rw-r--r--ext/mysqli/tests/041.phpt2
-rw-r--r--ext/mysqli/tests/045.phpt1
-rw-r--r--ext/mysqli/tests/047.phpt4
-rw-r--r--ext/mysqli/tests/049.phpt1
-rw-r--r--ext/mysqli/tests/061.phpt1
-rw-r--r--ext/mysqli/tests/connect.inc22
-rw-r--r--ext/mysqli/tests/skipif.inc5
-rw-r--r--ext/mysqli/tests/skipifemb.inc5
13 files changed, 40 insertions, 9 deletions
diff --git a/ext/mysqli/tests/001.phpt b/ext/mysqli/tests/001.phpt
index 880325bb5a..3f2f3c2d31 100644
--- a/ext/mysqli/tests/001.phpt
+++ b/ext/mysqli/tests/001.phpt
@@ -2,13 +2,14 @@
mysqli connect
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
$dbname = "test";
$test = "";
-
+
/*** test mysqli_connect localhost:port ***/
$link = mysqli_connect($host, $user, $passwd, "", 3306);
$test .= ($link) ? "1" : "0";
diff --git a/ext/mysqli/tests/014.phpt b/ext/mysqli/tests/014.phpt
index 69c347b88b..f8c02dba69 100644
--- a/ext/mysqli/tests/014.phpt
+++ b/ext/mysqli/tests/014.phpt
@@ -1,7 +1,7 @@
--TEST--
mysqli autocommit/commit/rollback
--SKIPIF--
-<?php
+<?php
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd);
$result = mysqli_query($link, "SHOW VARIABLES LIKE 'have_innodb'");
diff --git a/ext/mysqli/tests/017.phpt b/ext/mysqli/tests/017.phpt
index 7f51ca4b91..54d11ef719 100644
--- a/ext/mysqli/tests/017.phpt
+++ b/ext/mysqli/tests/017.phpt
@@ -2,6 +2,7 @@
mysqli fetch functions
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/033.phpt b/ext/mysqli/tests/033.phpt
index 3a56b5c678..5dddcc10c9 100644
--- a/ext/mysqli/tests/033.phpt
+++ b/ext/mysqli/tests/033.phpt
@@ -2,6 +2,7 @@
function test: mysqli_get_host_info
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/034.phpt b/ext/mysqli/tests/034.phpt
index 47c99f07e5..468861c3c2 100644
--- a/ext/mysqli/tests/034.phpt
+++ b/ext/mysqli/tests/034.phpt
@@ -2,6 +2,7 @@
function test: mysqli_get_proto_info
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/041.phpt b/ext/mysqli/tests/041.phpt
index e78c60a956..d6a9f954d0 100644
--- a/ext/mysqli/tests/041.phpt
+++ b/ext/mysqli/tests/041.phpt
@@ -15,8 +15,8 @@ function test: mysqli_warning_count()
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
mysqli_query($link, "CREATE TABLE test_warnings (a int not null");
+ mysqli_query($link, "INSERT INTO test_warnings VALUES (NULL)");
- mysqli_query($link, "INSERT INTO test_warnings VALUES (1),(2),(NULL)");
$num = mysqli_warning_count($link);
var_dump($num);
diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt
index 5a6efeafb7..2f9490c282 100644
--- a/ext/mysqli/tests/045.phpt
+++ b/ext/mysqli/tests/045.phpt
@@ -17,6 +17,7 @@ mysqli_bind_result (SHOW)
?>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/047.phpt b/ext/mysqli/tests/047.phpt
index d6ccb0df37..8663e8a641 100644
--- a/ext/mysqli/tests/047.phpt
+++ b/ext/mysqli/tests/047.phpt
@@ -31,7 +31,7 @@ mysqli_get_metadata
--EXPECTF--
array(2) {
[0]=>
- object(stdClass)#4 (11) {
+ object(stdClass)#5 (11) {
["name"]=>
string(3) "foo"
["orgname"]=>
@@ -56,7 +56,7 @@ array(2) {
int(0)
}
[1]=>
- object(stdClass)#5 (11) {
+ object(stdClass)#6 (11) {
["name"]=>
string(3) "bar"
["orgname"]=>
diff --git a/ext/mysqli/tests/049.phpt b/ext/mysqli/tests/049.phpt
index 13ea5594c3..8d16c3d4c7 100644
--- a/ext/mysqli/tests/049.phpt
+++ b/ext/mysqli/tests/049.phpt
@@ -2,6 +2,7 @@
mysql_fetch_row (OO-Style)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt
index 9c278353c6..caee2e49bb 100644
--- a/ext/mysqli/tests/061.phpt
+++ b/ext/mysqli/tests/061.phpt
@@ -2,6 +2,7 @@
local infile handler
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc
index aa1d30a17e..decdd87d51 100644
--- a/ext/mysqli/tests/connect.inc
+++ b/ext/mysqli/tests/connect.inc
@@ -3,8 +3,24 @@
/* default values are localhost, root and empty password
Change the values if you use another configuration */
- $host = "localhost";
- $user = "root";
- $passwd = "";
+ $driver = new mysqli_driver;
+
+ if (!$driver->embedded) {
+ $host = "localhost";
+ $user = "root";
+ $passwd = "";
+
+ $driver->embedded_server_start(FALSE, NULL, NULL);
+ } else {
+ $path = realpath('./ext/mysqli/tests');
+ $host = $user = $passwd = NULL;
+ $args = array(
+ "--datadir=$path",
+ "--innodb_data_home_dir=$path",
+ "--innodb_data_file_path=ibdata1:10M:autoextend",
+ "--log-error=$path/testrun.log"
+ );
+ $driver->embedded_server_start(TRUE, $args, NULL);
+ }
?>
diff --git a/ext/mysqli/tests/skipif.inc b/ext/mysqli/tests/skipif.inc
index eded86dc85..68a9c7cf0e 100644
--- a/ext/mysqli/tests/skipif.inc
+++ b/ext/mysqli/tests/skipif.inc
@@ -1 +1,4 @@
-<?php if (!extension_loaded('mysqli')) die('skip mysqli extension not available');?>
+<?php
+ if (!extension_loaded('mysqli'))
+ die('skip mysqli extension not available');
+?>
diff --git a/ext/mysqli/tests/skipifemb.inc b/ext/mysqli/tests/skipifemb.inc
new file mode 100644
index 0000000000..298c7219a6
--- /dev/null
+++ b/ext/mysqli/tests/skipifemb.inc
@@ -0,0 +1,5 @@
+<?php
+ $driver = new mysqli_driver();
+ if ($driver->embedded)
+ die("skip test doesn't run with embedded server");
+?>