本文整理汇总了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));
}
}
}