mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10678] Lowercase class name, adjust comment width
PHPBB3-10678
This commit is contained in:
parent
9bb2785da0
commit
ceacb63abf
3 changed files with 18 additions and 14 deletions
|
@ -36,8 +36,9 @@ found on the wiki (see below).
|
||||||
$dbuser = 'user';
|
$dbuser = 'user';
|
||||||
$dbpasswd = 'password';
|
$dbpasswd = 'password';
|
||||||
|
|
||||||
Alternatively you can specify parameters in the environment, so e.g. the following
|
Alternatively you can specify parameters in the environment, so e.g. the
|
||||||
will run phpunit with the same parameters as in the shown test_config.php file:
|
following will run phpunit with the same parameters as in the shown
|
||||||
|
test_config.php file:
|
||||||
|
|
||||||
$ PHPBB_TEST_DBMS='mysqli' PHPBB_TEST_DBHOST='localhost' \
|
$ PHPBB_TEST_DBMS='mysqli' PHPBB_TEST_DBHOST='localhost' \
|
||||||
PHPBB_TEST_DBNAME='database' PHPBB_TEST_DBUSER='user' \
|
PHPBB_TEST_DBNAME='database' PHPBB_TEST_DBUSER='user' \
|
||||||
|
@ -46,9 +47,10 @@ will run phpunit with the same parameters as in the shown test_config.php file:
|
||||||
Special Database Cases
|
Special Database Cases
|
||||||
----------------------
|
----------------------
|
||||||
In order to run tests on some of the databases that we support, it will be
|
In order to run tests on some of the databases that we support, it will be
|
||||||
necessary to provide a custom DSN string in test_config.php. This is only needed for
|
necessary to provide a custom DSN string in test_config.php. This is only
|
||||||
MSSQL 2000+ (PHP module), MSSQL via ODBC, and Firebird when PDO_Firebird does not work
|
needed for MSSQL 2000+ (PHP module), MSSQL via ODBC, and Firebird when
|
||||||
on your system (https://bugs.php.net/bug.php?id=61183). The variable must be named $custom_dsn.
|
PDO_Firebird does not work on your system
|
||||||
|
(https://bugs.php.net/bug.php?id=61183). The variable must be named $custom_dsn.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
Firebird using http://www.firebirdsql.org/en/odbc-driver/
|
Firebird using http://www.firebirdsql.org/en/odbc-driver/
|
||||||
|
@ -57,15 +59,17 @@ $custom_dsn = "Driver={Firebird/InterBase(r) driver};dbname=$dbhost:$dbname";
|
||||||
MSSQL
|
MSSQL
|
||||||
$custom_dsn = "Driver={SQL Server Native Client 10.0};Server=$dbhost;Database=$dbname";
|
$custom_dsn = "Driver={SQL Server Native Client 10.0};Server=$dbhost;Database=$dbname";
|
||||||
|
|
||||||
The other fields in test_config.php should be filled out as you would normally to connect
|
The other fields in test_config.php should be filled out as you would normally
|
||||||
to that database in phpBB.
|
to connect to that database in phpBB.
|
||||||
|
|
||||||
Additionally, you will need to be running the DbUnit fork from https://github.com/phpbb/dbunit/tree/phpbb.
|
Additionally, you will need to be running the DbUnit fork from
|
||||||
|
https://github.com/phpbb/dbunit/tree/phpbb.
|
||||||
|
|
||||||
Running
|
Running
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Once the prerequisites are installed, run the tests from the project root directory (above phpBB):
|
Once the prerequisites are installed, run the tests from the project root
|
||||||
|
directory (above phpBB):
|
||||||
|
|
||||||
$ phpunit
|
$ phpunit
|
||||||
|
|
||||||
|
@ -73,8 +77,8 @@ Slow tests
|
||||||
--------------
|
--------------
|
||||||
Certain tests, such as the UTF-8 normalizer or the DNS tests tend to be slow.
|
Certain tests, such as the UTF-8 normalizer or the DNS tests tend to be slow.
|
||||||
Thus these tests are in the `slow` group, which is excluded by default. You can
|
Thus these tests are in the `slow` group, which is excluded by default. You can
|
||||||
enable slow tests by copying the phpunit.xml.all file to phpunit.xml. If you only
|
enable slow tests by copying the phpunit.xml.all file to phpunit.xml. If you
|
||||||
want the slow tests, run:
|
only want the slow tests, run:
|
||||||
|
|
||||||
$ phpunit --group slow
|
$ phpunit --group slow
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
*
|
*
|
||||||
* This is used in the custom PHPUnit ODBC driver
|
* This is used in the custom PHPUnit ODBC driver
|
||||||
*/
|
*/
|
||||||
class phpbb_database_connection_ODBC_PDO_wrapper extends PDO
|
class phpbb_database_connection_odbc_pdo_wrapper extends PDO
|
||||||
{
|
{
|
||||||
// Name of the driver being used (i.e. mssql, firebird)
|
// Name of the driver being used (i.e. mssql, firebird)
|
||||||
public $driver = '';
|
public $driver = '';
|
||||||
|
|
|
@ -97,13 +97,13 @@ class phpbb_database_test_connection_manager
|
||||||
{
|
{
|
||||||
case 'mssql':
|
case 'mssql':
|
||||||
case 'mssql_odbc':
|
case 'mssql_odbc':
|
||||||
$this->pdo = new phpbb_database_connection_ODBC_PDO_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'firebird':
|
case 'firebird':
|
||||||
if (!empty($this->config['custom_dsn']))
|
if (!empty($this->config['custom_dsn']))
|
||||||
{
|
{
|
||||||
$this->pdo = new phpbb_database_connection_ODBC_PDO_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Fall through if they're using the firebird PDO driver and not the generic ODBC driver
|
// Fall through if they're using the firebird PDO driver and not the generic ODBC driver
|
||||||
|
|
Loading…
Add table
Reference in a new issue