ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


project:unittests

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
project:unittests [2025/07/29 03:35] – [Setup] mnewnhamproject:unittests [2025/08/01 00:37] (current) mnewnham
Line 6: Line 6:
 Configuration information for the tests is held in a configuration file adodb-unittest.ini. The file can be located anywhere in the PHP include path.  Configuration information for the tests is held in a configuration file adodb-unittest.ini. The file can be located anywhere in the PHP include path. 
  
-====== ADOdb Section ======+==== ADOdb Section ====
 If the ADOdb section is defined, and the item directory is set, the the tests can be run against an ADOdb installation set locally. This is useful if ADOdb is embedded into a different application If the ADOdb section is defined, and the item directory is set, the the tests can be run against an ADOdb installation set locally. This is useful if ADOdb is embedded into a different application
  
Line 14: Line 14:
 </code> </code>
  
-====== Driver Section ======+If the section is not defined, it assumes that the ADOdb installation is the parent directory of the unit test 
 + 
 +<code> 
 +/opt/ADOdb 
 +/opt/ADOdb/unittest 
 +</code> 
 + 
 +==== Blob Section ====  
 +This section must be defined, either with the path name to a binary file, such as a jpeg file that can be used for read-write testing. If set to false, all blob tests are skipped. 
 + 
 +<code> 
 +[blob] 
 +testBlob=c:/temp/someJpeg.jpg 
 +</code> 
 + 
 +==== Driver Section ====
 The driver configuration is based on the driver name. The driver configuration is based on the driver name.
  
Line 37: Line 52:
 |parameters|To set parameters normally set by ''setConnectionParameter()'', create a string in format **key=value;** Note that the parameters cannot be defined as constants, you must use the numeric or string equivalents|  |parameters|To set parameters normally set by ''setConnectionParameter()'', create a string in format **key=value;** Note that the parameters cannot be defined as constants, you must use the numeric or string equivalents| 
 |active|If a run-time parameter of the driver is not passed of the PHPunit version > 9, then the test is run against the first driver where the active flag is set to true| |active|If a run-time parameter of the driver is not passed of the PHPunit version > 9, then the test is run against the first driver where the active flag is set to true|
-===== Test Execution =====  
-==== PHPUnit 9 or lower ==== 
-<code> 
-phpunit unittest --bootstrap unittest/dbconnector.php <driver> 
-</code> 
  
-Where the <driver> name represents the ADOdb driver to use. For use of PDO drivers use the format pdo-<driver>. The driver name **__must__** follow the bootstrap file name+==== Meta Section ==== 
 +Unless explicitly enabled, the test to create new database using the //**createDatabase**// method is skipped as it requires CREATE DATABASE privilege on the DBMS. To enable this test, set the following section:
  
-==== PHPUnit 10 or higher ==== +<code>[meta] 
-<code> +skipDbCreation=0
-phpunit unittest --bootstrap unittest/dbconnector.php+
 </code> </code>
  
-The driver to test must have the **active** flag defined in the driver section 
  
-===== Testing Cache Functions =====+==== Caching Section ====
 Unless explicitly enabled, cache functions such as //**CacheExecute()**// are skipped. Tests only currently support Filesystem based caching. To activate this, add the following section to adodb-unittest.ini: Unless explicitly enabled, cache functions such as //**CacheExecute()**// are skipped. Tests only currently support Filesystem based caching. To activate this, add the following section to adodb-unittest.ini:
  
Line 63: Line 72:
 To disable cache tests while leaving the section in place, ''set cacheMethod=0'' To disable cache tests while leaving the section in place, ''set cacheMethod=0''
  
-===== Miscellaneous ===== +==== Globals Section ==== 
 To test some date functions, the local timezone must be equal to the server timezone. To change the timezone temporarily for the test, set the following gloval parameter in adodb-unittest.ini. This should exactly match the format in php.ini. To test some date functions, the local timezone must be equal to the server timezone. To change the timezone temporarily for the test, set the following gloval parameter in adodb-unittest.ini. This should exactly match the format in php.ini.
  
Line 72: Line 81:
  
 Any parameter saved into the **[globals]** section will be set using ini_set() Any parameter saved into the **[globals]** section will be set using ini_set()
 +
 +===== Test Execution ===== 
 +==== PHPUnit 9 or lower ====
 +<code>
 +phpunit unittest --bootstrap unittest/dbconnector.php <driver>
 +</code>
 +
 +Where the <driver> name represents the ADOdb driver to use. For use of PDO drivers use the format pdo-<driver>. The driver name **__must__** follow the bootstrap file name
 +
 +==== PHPUnit 10 or higher ====
 +<code>
 +phpunit unittest --bootstrap unittest/dbconnector.php
 +</code>
 +
 +The driver to test must have the **active** flag defined in the driver section
 +
 +
    
  
  
project/unittests.1753752921.txt.gz · Last modified: by mnewnham