- take connection parameter from connect.inc
- use proper UEXPECTF
- have 'print "done!"' or similar at the end to detect crashes
- whitespace changes where needed
- take care of portability: PHP 5 vs. PHP 5, MySQL 4.1 - 6.0
Pretty much the same cosmetics and tweaking as before (proper UEXPECTF,
"done!" at the end to detect crashes, connection parameter tweaking, ...) -
plus: check return codes even if failures are unlikely.
1) Try to have portable SQL, don't create your own schema unless the test
wants to test exactly this
2) Don't rely on default SQL sort orders
3) Use proper UEXPECTF. There have been a lot of tiny unicode issues when
ext/mysqli has returned a binary string in unicode mode although a
unicode string could be expected and vice versa
All the upcoming changes in the 0*.phpt files are pretty much the same. I'll
describe them only once in with a bit of detail.
1) Correct Whitespace (space vs. tab) if need be
2) Recall: you get the connection parameter from connect.inc, no DB name, no
port no other connection parameter in any of the tests!
3) At the end of each test you find a "print 'done!'" or similar. This is
most helpful to detect crashing/segfaulting tests with all run-tests.php
versions.
Some tests intentionally fail connecting to the DB. Not being able to
connect is no reason to skip the test. Also, no test should have hard-wired
connection parameter in it. Connection parameters come from connect.inc
(see environment variables in connect.inc).
Starting to merge the latest set of ext/mysqli tests from the mysqlnd
SVN repro into HEAD. Again, it might happen that I crash the set of tests
and don't mention one or the other change while merging. Blame me...
1) Note the new environment variables to control the test run
2) Variables $IS_MYSQLND and $MYSQLND_VERSION are for writing portable tests
3) sys_get_temp_dir function is for PHP5/PHP6 portability
- Fixed bug #41964 (strtotime returns a timestamp for non-time string of
pattern '(A|a) .+').
- Fixed bug #41844 (Format returns incorrect number of digits for negative
years -0001 to -0999).
- Fixed bug #41842 (Cannot create years < 0100 & negative years with
date_create or new DateTime).
- Fixed bug #41709 (strtotime() does not handle 00.00.0000).
- Fixed bug #41523 (strtotime('0000-00-00 00:00:00') is parsed as 1999-11-30).
1) Whitespace/CS
2) Portability: don't expect any values and have them in the [U]EXPECTF,
if they will be available only with certain MySQL Server versions.
Aside from whitespace / coding standards this one is more interesting.
We added a flag to check if a MySQL column type is a binary type. If so,
ext/mysql should return data for such columns not as unicode strings but
as binary strings if unicode.semantics is on.
1) Whitespace / Coding Standards
2) Don't even dare to have variables that sound like connection parameters and don't come from connect.inc
3) skipifem.inc is not there for ext/mysql tests
Whitespace/Coding Standards.
The tests origin from ext/mysqli/tests. ext/mysqli/tests should have a
skipifemb.inc, which is not needed and not available for ext/mysql/tests.
Nevertheless the tests tried to include that file.
Those two should be whitespace / coding standards only. However, in some of
my commit messages I might be wrong, it's hard to say what we added to the
tests and I might miss this or that little detail, although I check the diff
before commit.
Whitespace: replacing spaces with tab to follow coding conventions.
One tiny change in mysql_close.phpt: don't overrule connection parameter
in any of the tests. Alway take connection parameter, including the database
name ($db), from connect.inc.
Trying to fix broken tests. The last set of files committed a few weeks ago
broke almost all tests. I'll try to merge the CVS with a working set of
tests from the mysqlnd development repository. With this first set of
changes most tests should run (and pass) again.
Note the additional environment variables in connect.inc that you can
use to control a test run.