%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/var/www/html/ppaobm/vendor/codeception/base/tests/cli/ |
Upload File : |
<?php
class ExtensionsCest
{
// tests
public function useAlternativeFormatter(CliGuy $I)
{
$I->wantTo('use alternative formatter delivered through extensions');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run tests/dummy/FileExistsCept.php -c codeception_extended.yml');
$I->dontSeeInShellOutput("Check config");
$I->seeInShellOutput('[+] FileExistsCept');
$I->seeInShellOutput('Modules used: Filesystem, DumbHelper');
}
public function loadExtensionByOverride(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run tests/dummy/FileExistsCept.php -o "extensions: enabled: [\Codeception\Extension\SimpleReporter]"');
$I->dontSeeInShellOutput("Check config");
$I->seeInShellOutput('[+] FileExistsCept');
}
public function dynamicallyEnablingExtensions(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run dummy --ext DotReporter');
$I->seeInShellOutput('......');
$I->dontSeeInShellOutput('Optimistic');
$I->dontSeeInShellOutput('AnotherCest');
}
public function reRunFailedTests(CliGuy $I)
{
$ds = DIRECTORY_SEPARATOR;
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run unit FailingTest.php -c codeception_extended.yml --no-exit');
$I->seeInShellOutput('FAILURES');
$I->seeFileFound('failed', 'tests/_output');
$I->seeFileContentsEqual("tests{$ds}unit{$ds}FailingTest.php:testMe");
$I->executeCommand('run -g failed -c codeception_extended.yml --no-exit');
$I->seeInShellOutput('Tests: 1, Assertions: 1, Failures: 1');
$failGroup = "some-failed";
$I->executeCommand("run unit FailingTest.php -c codeception_extended.yml --no-exit --override \"extensions: config: Codeception\\Extension\\RunFailed: fail-group: {$failGroup}\"");
$I->seeInShellOutput('FAILURES');
$I->seeFileFound($failGroup, 'tests/_output');
$I->seeFileContentsEqual("tests{$ds}unit{$ds}FailingTest.php:testMe");
$I->executeCommand("run -g {$failGroup} -c codeception_extended.yml --no-exit --override \"extensions: config: Codeception\\Extension\\RunFailed: fail-group: {$failGroup}\"");
$I->seeInShellOutput('Tests: 1, Assertions: 1, Failures: 1');
}
public function checkIfExtensionsReceiveCorrectOptions(CliGuy $I)
{
$I->wantTo('check if extensions receive correct options');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run tests/dummy/AnotherCest.php:optimistic -c codeception_extended.yml');
$I->seeInShellOutput('Low verbosity');
$I->executeCommand('run tests/dummy/AnotherCest.php:optimistic -c codeception_extended.yml -v');
$I->seeInShellOutput('Medium verbosity');
$I->executeCommand('run tests/dummy/AnotherCest.php:optimistic -c codeception_extended.yml -vv');
$I->seeInShellOutput('High verbosity');
$I->executeCommand('run tests/dummy/AnotherCest.php:optimistic -c codeception_extended.yml -vvv');
$I->seeInShellOutput('Extreme verbosity');
}
public function runPerSuiteExtensions(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run extended,scenario', false);
$I->seeInShellOutput('Suite setup for extended');
$I->seeInShellOutput('Test setup for Hello');
$I->seeInShellOutput('Test teardown for Hello');
$I->seeInShellOutput('Suite teardown for extended');
$I->dontSeeInShellOutput('Suite setup for scenario');
$I->seeInShellOutput('Config1: value1');
$I->seeInShellOutput('Config2: value2');
}
public function runPerSuiteExtensionsInEnvironment(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run extended --env black', false);
$I->seeInShellOutput('Suite setup for extended');
$I->seeInShellOutput('Test setup for Hello');
$I->seeInShellOutput('Config1: black_value');
$I->seeInShellOutput('Config2: value2');
}
}