Tests

The PBMS extension comes with a set of test cases that can be used for testing PBMS and its API as well as a source of examples on how to do things.

Before running any of the tests you will need to edit the file "tests/custom_settings.ini" to setup the defaults used by the tests.

Some of the tests also assume the presents of test BLOB data in the 'test_blobs' folder. Any files found in this folder will be used as test BLOBs. The tests will load these files repeatedly until the required amount of data is loaded so you can put 1 or 100 files into this folder and the only thing it will effect is the variety of BLOBs used during testing. If you do not provide any test BLOBs a mini test BLOB will be created.

Some of the tests that load a lot of data may timeout before they can complete. If this happens you will need to set a higher timeout for the run-tests.php script.

Basic Tests Description

There are other tests in the 'tests' folder but these are the ones that are most likely to be of interest to people looking for examples.

003BasicInsert.phpt
Performs basic insertion of BLOB data directly into the MySQL table and reads it back out using the PBMS API.

Methods Used:

004StreamInsert.phpt
Performs stream based insert of BLOB data into the repository and insert of the BLOB reference into the MySQL table.

Methods Used:

005BufferedInsert.phpt
Performs buffered based insert BLOB data into the repository and insert of the BLOB reference into the MySQL table.

Methods Used:

006StreamInsert.phpt
Performs stream based insert BLOB data.

Methods Used:

007MD5Insert.phpt
Performs stream based insert BLOB data with md5 digest.

Methods Used:

008Metadata.phpt
Tests sending and receiving metadata.

Methods Used:

010PBMSUtilities.phpt
Tests utility methods.

Methods Used:

011MySQLdump.phpt
This test demonstrates how to backup and restore a BLOB repository using mysqldump. This test will need to run the 'mysqldump' utility as well as the 'mysql' client application.

013AsyncBackup.phpt
This test demonstrates how to backup and restore a BLOB repository using the PBMS engine level backup. It requires that the database server be running locally and the caller has privileges to shutdown and restart the database server as well as write access to the database server's data directory.

This test will perform the following operations: