public function checkCodeceptionTest(CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run order CodeTest.php --no-exit'); $I->seeFileFound('order.txt', 'tests/_log'); $I->expect('global bootstrap, initialization, beforeSuite, beforeClass, bootstrap, before, after, afterSuite, afterClass'); $I->seeFileContentsEqual("BI({B[C])}"); }
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(<<<EOF tests{$ds}unit{$ds}FailingTest.php:testMe EOF ); $I->executeCommand('run -g failed -c codeception_extended.yml --no-exit'); $I->seeInShellOutput('Tests: 1, Assertions: 1, Failures: 1'); }
public function replaceMultipleInFile(CliGuy $I) { $I->taskReplaceInFile('box/robo.txt')->from(array('HELLO', 'ROBO'))->to(array('Hello ', 'robo.li!'))->run(); $I->seeFileFound('box/robo.txt'); $I->seeFileContentsEqual('Hello robo.li!'); }
<?php $I = new CliGuy($scenario); $I->wantTo('generate scenarios сценарий'); $I->amInPath('tests/data/sandbox'); $I->executeCommand('generate:scenarios dummy'); $I->seeFileFound('File_Exists.txt', 'tests/_data/scenarios'); $I->seeFileContentsEqual(<<<EOF I WANT TO CHECK CONFIG EXISTS I see file found "codeception.yml" EOF );
<?php $I = new CliGuy($scenario); $I->wantTo('concat files using Concat Task'); $I->amInPath(codecept_data_dir() . 'sandbox'); $I->taskConcat(['a.txt', 'b.txt'])->to('merged.txt')->run(); $I->seeFileFound('merged.txt'); $I->seeFileContentsEqual('AB');
<?php $I = new CliGuy($scenario); $I->wantTo('concat files using Concat Task'); $I->amInPath(codecept_data_dir() . 'sandbox'); $I->taskConcat(['a.txt', 'b.txt'])->to('merged.txt')->run(); $I->seeFileFound('merged.txt'); $I->seeFileContentsEqual("A\nB\n");
public function replaceInFile(CliGuy $I) { $I->taskReplaceInFile('a.txt')->from('A')->to('B')->run(); $I->seeFileFound('a.txt'); $I->seeFileContentsEqual('B'); }