本文整理匯總了PHP中Codeception\TestCase::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestCase::getName方法的具體用法?PHP TestCase::getName怎麽用?PHP TestCase::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Codeception\TestCase
的用法示例。
在下文中一共展示了TestCase::getName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _after
public function _after(TestCase $test)
{
$this->debug(__CLASS__ . '::' . __FUNCTION__ . '()');
$unfinished_transaction = $this->transaction_level > 0;
if ($unfinished_transaction) {
$this->debug("Unfinished transaction was found; rolling back (after test '{$test->getName(false)}')");
// wrap up the transaction so that the clean-up below can succeed.
// it is not possible to switch connectors mid-transaction.
$this->rollbackTransaction();
}
foreach ($this->test_cleanup_actions as $cleanup_action) {
$this->debugSection('cleanup', $cleanup_action->getDefinition());
call_user_func($cleanup_action, $this);
}
if ($unfinished_transaction) {
$this->fail("Unfinished transaction was found (after test '{$test->getName(false)}')");
}
$this->test_cleanup_actions = [];
parent::_after($test);
}
示例2: _before
/**
* Override method to add test name to the capabilities.
* Name will be shown in sauce labs / testing bot / browser stack services
*
* @param TestCase $test
*/
public function _before(TestCase $test)
{
$this->config['capabilities']['name'] = get_class($test->getTestClass()) . ':' . $test->getName();
parent::_before($test);
}
示例3: _failed
public function _failed(TestCase $test, $fail)
{
$this->debug(__CLASS__ . '::_failed [' . $test->getName() . ']');
$this->deinitSignalHandler();
parent::_failed($test, $fail);
}