There are some test cases in directory tests. These unit tests are changed based on test cases of PHP PDO, which using the PHP official unit test mechanism. The script run-tests.php is PHP official unit test tool.
Before running these unit tests, you should add the CUBRID database information on you system in pdo_test.inc.
Make sure that the demodb is created in CUBRID, and set db to demodb. The "demodb" normally will be created when you install CUBRID. If you didn't install it, you can create it later. In Linux, for example, in $CUBRID/demo, run the following commands:
sh make_cubrid_demo.sh
Then demodb will be created. You can also change the scripts and run test codes on other database.
Before run these unit tests, you should indicate which php executable to test by setting environment TEST_PHP_EXECUTABLE. Then run test codes on command line:
For example:
php run-tests.php pdo_001.phpt
Number of tests : |
62 |
62 |
Tests skipped : |
0 ( 0.0%) |
-------- |
Tests warned : |
0 ( 0.0%) |
( 0.0%) |
Tests failed : |
2 ( 3.2%) |
( 3.2%) |
Expected fail : |
1 ( 1.6%) |
( 1.6%) |
Tests passed : |
59 ( 95.2%) |
( 95.2%) |
Time taken : |
12 seconds |
FAILED TEST SUMMARY
PDO Common: Bug #43130 (Bound parameters cannot have - in their name) bug_43130.phpt
PDO Common: PDOStatement::getColumnMeta pdo_022.phpt
EXPECTED FAILED TEST SUMMARY
PDO Common: Bug #34630 (inserting streams as LOBs) bug_34630.phpt
bug_43130.phpt: The output of CUBRID PDO is different with expected output. Just remember that don't use - in named parameter. pdo_022.phpt: CUBRID don't support getColumnMeta. If you want get meta information, please use PDO::cubrid_schema.