Yaffs site version 1.1
[yaffs-website] / vendor / gabordemooij / redbean / testing / RedUNIT / Base.php
1 <?php
2
3 namespace RedUNIT;
4
5 /**
6  * Base
7  *
8  * This is the base class for all multi-driver Unit Tests.
9  * By default base class derived tests will offer 'test rounds' for
10  * all well known RedBeanPHP drivers: mysql (MySQL/MariaDB), pgsql (PostgreSQL),
11  * sqlite (SQLite3) and CUBRID (CUBRID).
12  *
13  * @file    RedUNIT/Base.php
14  * @desc    Base class for all drivers that support all database systems.
15  * @author  Gabor de Mooij and the RedBeanPHP Community
16  * @license New BSD/GPLv2
17  *
18  * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
19  * This source file is subject to the New BSD/GPLv2 License that is bundled
20  * with this source code in the file license.txt.
21  */
22 class Base extends RedUNIT
23 {
24
25         /**
26          * List of DB drivers.
27          * Contains the list of database drivers as returned by getTargetDrivers().
28          *
29          * @var array
30          */
31         protected static $driverList = array( 'mysql', 'pgsql', 'sqlite', 'CUBRID' );
32
33         /**
34          * Adds a driver to the list.
35          *
36          * @param string $driverID driver identifier.
37          */
38         public static function addToDriverList( $driverID )
39         {
40                 self::$driverList[] = $driverID;
41         }
42
43         /**
44          * Returns a list of drivers for which this driver supports
45          * 'test rounds'. This class only supports all base drivers.
46          *
47          * @see RedUNIT::getTargetDrivers() for details.
48          *
49          * @return array
50          */
51         public function getTargetDrivers()
52         {
53                 return self::$driverList;
54         }
55 }