本文整理汇总了PHP中UnitTestCase::before方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTestCase::before方法的具体用法?PHP UnitTestCase::before怎么用?PHP UnitTestCase::before使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitTestCase
的用法示例。
在下文中一共展示了UnitTestCase::before方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before
/**
* Announces the start of a test.
*
* @param string $method Test method just started.
* @return void
* @access public
*/
function before($method)
{
parent::before($method);
if (isset($this->fixtures) && (!is_array($this->fixtures) || empty($this->fixtures))) {
unset($this->fixtures);
}
// Set up DB connection
if (isset($this->fixtures) && strtolower($method) == 'start') {
$this->_initDb();
$this->_loadFixtures();
}
// Create records
if (isset($this->_fixtures) && isset($this->db) && !in_array(strtolower($method), array('start', 'end')) && $this->__truncated && $this->autoFixtures == true) {
foreach ($this->_fixtures as $fixture) {
$inserts = $fixture->insert($this->db);
}
}
if (!in_array(strtolower($method), $this->methods)) {
$this->startTest($method);
}
}
示例2: before
/**
* Announces the start of the test.
* @param string $method Test method just started.
* @access public
*/
function before($method)
{
parent::before($this->cleanCamelCase($method));
}
示例3: before
/**
* Announces the start of a test.
*
* @param string $method Test method just started.
*
* @access public
*/
function before($method)
{
parent::before($method);
if (isset($this->fixtures) && (!is_array($this->fixtures) || empty($this->fixtures))) {
unset($this->fixtures);
}
// Set up DB connection
if (isset($this->fixtures) && low($method) == 'start') {
$this->_initDb();
$this->_loadFixtures();
}
// Create records
if (isset($this->_fixtures) && isset($this->db) && !in_array(low($method), array('start', 'end'))) {
foreach ($this->_fixtures as $fixture) {
$inserts = $fixture->insert();
if (isset($inserts) && !empty($inserts)) {
foreach ($inserts as $query) {
if (isset($query) && $query !== false) {
$this->db->_execute($query);
}
}
}
}
}
if (!in_array(low($method), $this->methods)) {
$this->startTest($method);
}
}
示例4: before
/**
* Announces the start of the test.
* @param string $method Test method just started.
* @access public
*/
function before($method)
{
parent::before($method);
$this->setBrowser($this->createBrowser());
}