backupStaticAttributesBlacklist += array(
'PHP_CodeCoverage' => array('instance'),
'PHP_CodeCoverage_Filter' => array('instance'),
'PHP_CodeCoverage_Util' => array('ignoredLines', 'templateMethods'),
'PHP_Timer' => array('startTimes',),
'PHP_Token_Stream' => array('customTokens'),
'PHP_Token_Stream_CachingFactory' => array('cache'),
'phpbb_database_test_case' => array('already_connected'),
);
}
public function createXMLDataSet($path)
{
$db_config = $this->get_database_config();
// Firebird requires table and column names to be uppercase
if ($db_config['dbms'] == 'firebird')
{
$xml_data = file_get_contents($path);
$xml_data = preg_replace_callback('/(?:(
))/', 'phpbb_database_test_case::to_upper', $xml_data);
$xml_data = preg_replace_callback('/(?:())([a-z_]+)(?:(<\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data);
$new_fixture = tmpfile();
fwrite($new_fixture, $xml_data);
fseek($new_fixture, 0);
$meta_data = stream_get_meta_data($new_fixture);
$path = $meta_data['uri'];
}
return parent::createXMLDataSet($path);
}
public function get_test_case_helpers()
{
if (!$this->test_case_helpers)
{
$this->test_case_helpers = new phpbb_test_case_helpers($this);
}
return $this->test_case_helpers;
}
public function get_database_config()
{
$config = phpbb_test_case_helpers::get_test_config();
if (!isset($config['dbms']))
{
$this->markTestSkipped('Missing test_config.php: See first error.');
}
return $config;
}
public function getConnection()
{
$config = $this->get_database_config();
$manager = $this->create_connection_manager($config);
if (!self::$already_connected)
{
$manager->recreate_db();
}
$manager->connect();
if (!self::$already_connected)
{
$manager->load_schema();
self::$already_connected = true;
}
return $this->createDefaultDBConnection($manager->get_pdo(), 'testdb');
}
public function new_dbal()
{
global $phpbb_root_path, $phpEx;
$config = $this->get_database_config();
require_once dirname(__FILE__) . '/../../phpBB/includes/db/' . $config['dbms'] . '.php';
$dbal = 'dbal_' . $config['dbms'];
$db = new $dbal();
$db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
return $db;
}
public function assertSqlResultEquals($expected, $sql, $message = '')
{
$db = $this->new_dbal();
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$this->assertEquals($expected, $rows, $message);
}
public function setExpectedTriggerError($errno, $message = '')
{
$this->get_test_case_helpers()->setExpectedTriggerError($errno, $message);
}
protected function create_connection_manager($config)
{
return new phpbb_database_test_connection_manager($config);
}
/**
* Converts a match in the middle of a string to uppercase.
* This is necessary for transforming the fixture information for Firebird tests
*
* @param $matches The array of matches from a regular expression
*
* @return string The string with the specified match converted to uppercase
*/
static public function to_upper($matches)
{
return $matches[1] . strtoupper($matches[2]) . $matches[3];
}
}
3N5r"vlPS4f=` lv%RwcIt2gj!!f(Fk]4-5ǃ,J~ W^e5~pA>M]>ȇEMbo`q`i@QfoZikOjBN.fF3Paû͵!4#teފі6~ȝu$D!gt)-:s*գ ؚM-~ʠŮz0*A
x{cڲ >g}cMo@M
2 \yu4_v@m[nOB@W1
Ⅹf*_+i5܅:⭮1_ ӭ(adt#H( 7 ]]UlYF X KjVp,?%B[H$Nl">s b6LDZ_iDAbXс_V)4{_,H4@F u\9I}E]kv =^N k|\α&'ɚa6(|w4iSڐtA Z41MQ%i!nͳ&* ~-=7gÝ*~!Гj0RڳE%p#Q]
39/JV;myx8+<3i^ۤZ:%@<:ok; 씶nf"!EV4OuEPۻa&WhN̯JXUEMG
;@ vpᆷѵ%>+Z2:
&-ncjtAƈ~BF>A[*Qx[e|+x]
-B2!!1Oc
)MMNo_փ[HA@Vh㉑pm8>9{Kw'3tO Ɣ{-RBeWG?PXCn;r .2$nf<c}{E?-QSjT! LȀb}RӮN%A]Ol'[8}ln{p2a2\zV@mD[:)B?p^qjwop9ׂ6%a֘hGzS
!^-!ǸOp6LBzҩ^1|b:RA^j @^Ak/$,nk͜Δ o^yaof7/C7+M֗j]gj j=mW?/!>nWZZ{v{Ja/@z}yx!Hh:<$I8'neiR1\w jw{qf7AjsQ|m&]oV_^+D_Ygc9|n_`kbi@k)}2W1jCypiCm9hzH*e~ (T}6Ybɵ8'XБ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