本文整理匯總了PHP中Codeception\TestCase::getTestFullName方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestCase::getTestFullName方法的具體用法?PHP TestCase::getTestFullName怎麽用?PHP TestCase::getTestFullName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Codeception\TestCase
的用法示例。
在下文中一共展示了TestCase::getTestFullName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCeptNamings
/**
* @group core
*/
public function testCeptNamings()
{
$cept = new \Codeception\TestCase\Cept();
$cept->configName('LoginCept.php')->config('testFile', 'tests/acceptance/LoginCept.php');
$this->assertEquals('tests/acceptance/LoginCept.php', \Codeception\TestCase::getTestFileName($cept));
$this->assertEquals('tests/acceptance/LoginCept.php', \Codeception\TestCase::getTestFullName($cept));
$this->assertEquals('LoginCept', \Codeception\TestCase::getTestSignature($cept));
}
示例2: testCestNamings
/**
* @group core
*/
public function testCestNamings()
{
$cept = new \Codeception\TestCase\Cest();
$klass = new stdClass();
$cept->config('testClassInstance', $klass)->config('testMethod', 'user')->config('testFile', 'tests/acceptance/LoginCest.php');
$this->assertEquals('tests/acceptance/LoginCest.php:user', \Codeception\TestCase::getTestFullName($cept));
$this->assertEquals('tests/acceptance/LoginCest.php', \Codeception\TestCase::getTestFileName($cept));
$this->assertEquals('stdClass::user', \Codeception\TestCase::getTestSignature($cept));
}
示例3: saveFailed
public function saveFailed(PrintResultEvent $e)
{
$file = $this->getLogDir() . $this->config['file'];
$result = $e->getResult();
if ($result->wasSuccessful()) {
if (is_file($file)) {
unlink($file);
}
return;
}
$output = [];
foreach ($result->failures() as $fail) {
$output[] = $this->localizePath(TestCase::getTestFullName($fail->failedTest()));
}
foreach ($result->errors() as $fail) {
$output[] = $this->localizePath(TestCase::getTestFullName($fail->failedTest()));
}
file_put_contents($file, implode("\n", $output));
}
示例4: run
public function run()
{
if (!class_exists('\\Codeception\\Lib\\TestLoader')) {
throw new TaskException($this, "This task requires Codeception to be loaded. Please require autoload.php of Codeception");
}
$testLoader = new \Codeception\Lib\TestLoader($this->testsFrom);
$testLoader->loadTests();
$tests = $testLoader->getTests();
$i = 0;
$groups = [];
$this->printTaskInfo("Processing " . count($tests) . " files");
// splitting tests by groups
foreach ($tests as $test) {
$groups[$i % $this->numGroups + 1][] = \Codeception\TestCase::getTestFullName($test);
$i++;
}
// saving group files
foreach ($groups as $i => $tests) {
$filename = $this->saveTo . $i;
$this->printTaskInfo("Writing {$filename}");
file_put_contents($filename, implode("\n", $tests));
}
}
示例5: checkEnvironmentExists
protected function checkEnvironmentExists(\Codeception\TestCase $test)
{
$envs = $test->getEnvironment();
if (empty($envs)) {
return;
}
if (!isset($this->settings['env'])) {
Notification::warning("Environments are not configured", TestCase::getTestFullName($test));
return;
}
$availableEnvironments = array_keys($this->settings['env']);
$listedEnvironments = explode(',', implode(',', $test->getEnvironment()));
foreach ($listedEnvironments as $env) {
if (!in_array($env, $availableEnvironments)) {
Notification::warning("Environment {$env} was not configured but used in test", TestCase::getTestFullName($test));
}
}
}