本文整理汇总了PHP中Codeception\TestCase::getTestSignature方法的典型用法代码示例。如果您正苦于以下问题:PHP TestCase::getTestSignature方法的具体用法?PHP TestCase::getTestSignature怎么用?PHP TestCase::getTestSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Codeception\TestCase
的用法示例。
在下文中一共展示了TestCase::getTestSignature方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _failed
public function _failed(TestCase $test, $fail)
{
if (!$this->client || !$this->client->getInternalResponse()) {
return;
}
$this->_savePageSource(codecept_output_dir() . str_replace(['::', '\\', '/'], ['.', '.', '.'], TestCase::getTestSignature($test)) . '.fail.html');
}
示例2: _failed
public function _failed(TestCase $test, $fail)
{
if (!$this->client || !$this->client->getInternalResponse()) {
return;
}
$filename = str_replace(['::', '\\', '/'], ['.', '', ''], TestCase::getTestSignature($test)) . '.fail.html';
file_put_contents(codecept_output_dir($filename), $this->client->getInternalResponse()->getContent());
}
示例3: 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));
}
示例4: 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));
}
示例5: getTestNames
protected function getTestNames($tests)
{
$testNames = [];
foreach ($tests as $test) {
if ($test instanceof \PHPUnit_Framework_TestCase) {
$testNames[] = \Codeception\TestCase::getTestSignature($test);
}
}
return $testNames;
}
示例6: assertContainsTestName
protected function assertContainsTestName($name, $tests)
{
foreach ($tests as $test) {
if ($test instanceof \PHPUnit_Framework_TestCase) {
$testName = \Codeception\TestCase::getTestSignature($test);
if ($testName == $name) {
return;
}
codecept_debug($testName);
}
}
$this->fail("{$name} not found in tests");
}
示例7: _failed
public function _failed(\Codeception\TestCase $test, $fail)
{
$filename = str_replace(['::', '\\', '/'], ['.', '', ''], \Codeception\TestCase::getTestSignature($test)) . '.fail.png';
$this->_saveScreenshot(codecept_output_dir($filename));
$this->debug("Screenshot was saved into '_output' dir");
}
示例8: persist
public function persist(TestEvent $e)
{
if (!$this->webDriverModule or !$this->dir) {
return;
}
$indicatorHtml = '';
$slideHtml = '';
foreach ($this->slides as $i => $step) {
$indicatorHtml .= (new Template($this->indicatorTemplate))->place('step', (int) $i)->place('isActive', (int) $i ? '' : 'class="active"')->produce();
$slideHtml .= (new Template($this->slidesTemplate))->place('image', $i)->place('caption', $step->getHumanizedArguments())->place('isActive', (int) $i ? '' : 'active')->place('isError', $step->hasFailed() ? 'error' : '')->produce();
}
$html = (new Template($this->template))->place('indicators', $indicatorHtml)->place('slides', $slideHtml)->place('feature', ucfirst($e->getTest()->getFeature()))->place('test', TestCase::getTestSignature($e->getTest()))->produce();
$indexFile = $this->dir . DIRECTORY_SEPARATOR . 'index.html';
file_put_contents($indexFile, $html);
$testName = TestCase::getTestSignature($e->getTest()) . ' - ' . ucfirst($e->getTest()->getFeature());
$this->recordedTests[$testName] = substr($indexFile, strlen(codecept_output_dir()));
}
示例9: _failed
public function _failed(TestCase $test, $fail)
{
$this->debugWebDriverLogs();
$filename = str_replace(['::', '\\', '/'], ['.', '', ''], TestCase::getTestSignature($test)) . '.fail';
$this->_saveScreenshot(codecept_output_dir() . $filename . '.png');
$this->_savePageSource(codecept_output_dir() . $filename . '.html');
$this->debug("Screenshot and page source were saved into '_output' dir");
}
示例10: persist
public function persist(TestEvent $e)
{
if (!$this->webDriverModule or !$this->dir) {
return;
}
$indicatorHtml = '';
$slideHtml = '';
foreach ($this->slides as $i => $step) {
$indicatorHtml .= (new Template($this->indicatorTemplate))->place('step', (int) $i)->place('isActive', (int) $i ? '' : 'class="active"')->produce();
$slideHtml .= (new Template($this->slidesTemplate))->place('image', $i)->place('caption', $step->getHtml('#3498db'))->place('isActive', (int) $i ? '' : 'active')->place('isError', $step->hasFailed() ? 'error' : '')->produce();
}
$html = (new Template($this->template))->place('indicators', $indicatorHtml)->place('slides', $slideHtml)->place('feature', ucfirst($e->getTest()->getFeature()))->place('test', TestCase::getTestSignature($e->getTest()))->produce();
file_put_contents($this->dir . DIRECTORY_SEPARATOR . 'index.html', $html);
}
示例11: _failed
public function _failed(\Codeception\TestCase $test, $fail)
{
$filename = str_replace(['::', '\\', '/'], ['.', '', ''], \Codeception\TestCase::getTestSignature($test)) . '.fail';
$this->_saveScreenshot(codecept_output_dir() . $filename . '.png');
file_put_contents(codecept_output_dir() . $filename . '.html', $this->webDriver->getPageSource());
$this->debug("Screenshot and HTML snapshot were saved into '_output' dir");
}