本文整理汇总了PHP中CiviUnitTestCase::_dbName方法的典型用法代码示例。如果您正苦于以下问题:PHP CiviUnitTestCase::_dbName方法的具体用法?PHP CiviUnitTestCase::_dbName怎么用?PHP CiviUnitTestCase::_dbName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CiviUnitTestCase
的用法示例。
在下文中一共展示了CiviUnitTestCase::_dbName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* Because we are overriding the parent class constructor, we
* need to show the same arguments as exist in the constructor of
* PHPUnit_Framework_TestCase, since
* PHPUnit_Framework_TestSuite::createTest() creates a
* ReflectionClass of the Test class and checks the constructor
* of that class to decide how to set up the test.
*
* @param string $name
* @param array $data
* @param string $dataName
*/
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
// we need full error reporting
error_reporting(E_ALL & ~E_NOTICE);
self::$_dbName = self::getDBName();
// also load the class loader
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();
if (function_exists('_civix_phpunit_setUp')) {
// FIXME: loosen coupling
_civix_phpunit_setUp();
}
}
示例2: __construct
/**
* Constructor.
*
* Because we are overriding the parent class constructor, we
* need to show the same arguments as exist in the constructor of
* PHPUnit_Framework_TestCase, since
* PHPUnit_Framework_TestSuite::createTest() creates a
* ReflectionClass of the Test class and checks the constructor
* of that class to decide how to set up the test.
*
* @param string $name
* @param array $data
* @param string $dataName
*/
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
// we need full error reporting
error_reporting(E_ALL & ~E_NOTICE);
if (!empty($GLOBALS['mysql_db'])) {
self::$_dbName = $GLOBALS['mysql_db'];
} else {
self::$_dbName = 'civicrm_tests_dev';
}
// create test database
self::$utils = new Utils($GLOBALS['mysql_host'], $GLOBALS['mysql_port'], $GLOBALS['mysql_user'], $GLOBALS['mysql_pass']);
// also load the class loader
require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();
if (function_exists('_civix_phpunit_setUp')) {
// FIXME: loosen coupling
_civix_phpunit_setUp();
}
}