From 93ceb95f1504d6ea9c192fab57e5cfac909612f2 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Fri, 3 Jul 2020 09:53:29 -0500 Subject: [PATCH 1/4] add README for ext/mysqli tests --- ext/mysqli/tests/README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ext/mysqli/tests/README.md diff --git a/ext/mysqli/tests/README.md b/ext/mysqli/tests/README.md new file mode 100644 index 0000000000000..de7b49baa6c07 --- /dev/null +++ b/ext/mysqli/tests/README.md @@ -0,0 +1,34 @@ +# The mysqli extension tests + +There are default values for `MYSQL_TEST_HOST`, `MYSQL_TEST_USER`, `MYSQL_TEST_DB` and `MYSQL_TEST_PASSWD`. If your values differ from the defaults, then the environment variables must be set. + +```bash +# Database host +# Default: localhost +MYSQL_TEST_HOST + +# Database port +MYSQL_TEST_PORT + +# Database user +# Default: root +MYSQL_TEST_USER + +# Database user password +# The default password is empty (no password). +MYSQL_TEST_PASSWD + +# Database name +# Default: test +MYSQL_TEST_DB + +# Storage engine to use +MYSQL_TEST_ENGINE + +# Database server socket +MYSQL_TEST_SOCKET +``` + +## MySQL User Permissions + +The MySQL user used to run the tests must have full permissions on the test database. \ No newline at end of file From ff973503b1ce4fb7b2761de20b7e9dac6d26ee01 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Fri, 3 Jul 2020 12:30:36 -0500 Subject: [PATCH 2/4] add instructions for database creation to run tests --- ext/mysqli/tests/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/mysqli/tests/README.md b/ext/mysqli/tests/README.md index de7b49baa6c07..905ee1c9fd684 100644 --- a/ext/mysqli/tests/README.md +++ b/ext/mysqli/tests/README.md @@ -1,6 +1,11 @@ # The mysqli extension tests -There are default values for `MYSQL_TEST_HOST`, `MYSQL_TEST_USER`, `MYSQL_TEST_DB` and `MYSQL_TEST_PASSWD`. If your values differ from the defaults, then the environment variables must be set. +To run the tests, a test database must be created in the MySQL command-line: +```sql +CREATE DATABASE 'test'; +``` + +There are default values for `MYSQL_TEST_HOST`, `MYSQL_TEST_USER`, `MYSQL_TEST_DB` and `MYSQL_TEST_PASSWD`. If your values differ from the defaults, then environment variables must be set. ```bash # Database host From ebe786d4b47e85233b5ee964ea441d31a3049d38 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Fri, 3 Jul 2020 12:38:28 -0500 Subject: [PATCH 3/4] explain that creating a dedicated table is unnecessary --- ext/mysqli/tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mysqli/tests/README.md b/ext/mysqli/tests/README.md index 905ee1c9fd684..6208366023343 100644 --- a/ext/mysqli/tests/README.md +++ b/ext/mysqli/tests/README.md @@ -5,7 +5,7 @@ To run the tests, a test database must be created in the MySQL command-line: CREATE DATABASE 'test'; ``` -There are default values for `MYSQL_TEST_HOST`, `MYSQL_TEST_USER`, `MYSQL_TEST_DB` and `MYSQL_TEST_PASSWD`. If your values differ from the defaults, then environment variables must be set. +The test suite will create the necessary tables for testing, and then delete them when testing is complete. Creating a dedicated table prior to running the tests is unnecessary. There are default values for `MYSQL_TEST_HOST`, `MYSQL_TEST_USER`, `MYSQL_TEST_DB` and `MYSQL_TEST_PASSWD`. If your values differ from the defaults, then environment variables must be set. ```bash # Database host From 80f968c2217693319df1f1c2eeeea278a2f7b120 Mon Sep 17 00:00:00 2001 From: Tiffany Date: Fri, 3 Jul 2020 12:47:03 -0500 Subject: [PATCH 4/4] fix database name in example (thanks cmb) --- ext/mysqli/tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mysqli/tests/README.md b/ext/mysqli/tests/README.md index 6208366023343..4fc3767e49706 100644 --- a/ext/mysqli/tests/README.md +++ b/ext/mysqli/tests/README.md @@ -2,7 +2,7 @@ To run the tests, a test database must be created in the MySQL command-line: ```sql -CREATE DATABASE 'test'; +CREATE DATABASE test; ``` The test suite will create the necessary tables for testing, and then delete them when testing is complete. Creating a dedicated table prior to running the tests is unnecessary. There are default values for `MYSQL_TEST_HOST`, `MYSQL_TEST_USER`, `MYSQL_TEST_DB` and `MYSQL_TEST_PASSWD`. If your values differ from the defaults, then environment variables must be set.