本文整理汇总了PHP中codecept_log_dir函数的典型用法代码示例。如果您正苦于以下问题:PHP codecept_log_dir函数的具体用法?PHP codecept_log_dir怎么用?PHP codecept_log_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了codecept_log_dir函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateSnapshotOnFail
public function testCreateSnapshotOnFail()
{
$module = Stub::construct(get_class($this->module), [make_container()], ['_savePageSource' => Stub::once(function ($filename) {
$this->assertEquals(codecept_log_dir('Codeception.Module.UniversalFramework.looks.like..test.fail.html'), $filename);
})]);
$module->amOnPage('/');
$cest = new \Codeception\Test\Cest($this->module, 'looks:like::test', 'demo1Cest.php');
$module->_failed($cest, new PHPUnit_Framework_AssertionFailedError());
}
示例2: makeScreenshot
/**
* Takes a screenshot of the current window and saves it to `tests/_output/debug`.
*
* ``` php
* <?php
* $I->amOnPage('/user/edit');
* $I->makeScreenshot('edit_page');
* // saved to: tests/_output/debug/edit_page.png
* ?>
* ```
*
* @param $name
*/
public function makeScreenshot($name)
{
$debugDir = codecept_log_dir() . 'debug';
if (!is_dir($debugDir)) {
mkdir($debugDir, 0777);
}
$screenName = $debugDir . DIRECTORY_SEPARATOR . $name . '.png';
$this->_saveScreenshot($screenName);
$this->debug("Screenshot saved to {$screenName}");
}
示例3: testCreateTestScreenshotOnFail
public function testCreateTestScreenshotOnFail()
{
$test = Stub::make('\\Codeception\\TestCase\\Test', ['getName' => 'testLogin']);
$fakeWd = Stub::make(self::WEBDRIVER_CLASS, ['takeScreenshot' => Stub::once(function ($filename) use($test) {
PHPUnit_Framework_Assert::assertEquals(codecept_log_dir(get_class($test) . '.testLogin.fail.png'), $filename);
}), 'getPageSource' => Stub::once(function () {
}), 'manage' => Stub::make('\\Facebook\\WebDriver\\WebDriverOptions', ['getAvailableLogTypes' => Stub::atLeastOnce(function () {
return [];
})])]);
$module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]);
$module->_failed($test, new PHPUnit_Framework_AssertionFailedError());
}
示例4: testCreateTestScreenshotOnFail
public function testCreateTestScreenshotOnFail()
{
$test = Stub::make('\\Codeception\\TestCase\\Test', ['getName' => 'testLogin']);
$fakeWd = Stub::make('\\RemoteWebDriver', ['takeScreenshot' => Stub::once(function ($filename) use($test) {
PHPUnit_Framework_Assert::assertEquals(codecept_log_dir(get_class($test) . '.testLogin.fail.png'), $filename);
}), 'getPageSource' => Stub::once(function () {
})]);
$this->module->webDriver = $fakeWd;
$this->module->_failed($test, new PHPUnit_Framework_AssertionFailedError());
}
示例5: testCreateTestScreenshotOnFail
public function testCreateTestScreenshotOnFail()
{
$test = Stub::make('\\Codeception\\TestCase\\Test', ['getName' => 'testLogin']);
$wd = Stub::make('\\Codeception\\Module\\WebDriver', ['_saveScreenshot' => Stub::once(function ($actual) use($test) {
PHPUnit_Framework_Assert::assertEquals(codecept_log_dir(get_class($test) . '.testLogin.fail.png'), $actual);
})]);
$wd->_failed($test, new PHPUnit_Framework_AssertionFailedError());
}