public function checkTwoFiles(CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run order --no-exit'); $I->seeFileFound('order.txt', 'tests/_log'); $I->seeInThisFile("IBSBSBS([BST][BSTF][BST])"); }
public function configStartWithWrongPath(CliGuy $I) { $I->wantTo('start codeception with wrong path to a codeception.yml file'); $I->amInPath('tests/data/register_command/'); $I->executeFailCommand('-c no/exists/codeception.yml'); $I->seeInShellOutput('Your configuration file `no/exists/codeception.yml` could not be found.'); }
public function checkAfterBeforeClassInTests(CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run order BeforeAfterClassTest.php'); $I->seeFileFound('order.txt', 'tests/_output'); $I->seeInThisFile('BIB({[1][2])}'); }
public function runOneGroup(\CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run skipped -g notorun'); $I->seeInShellOutput("Incomplete"); $I->dontSeeInShellOutput("Skipped"); }
public function checkEnvParamsPassed(CliGuy $I) { $I->amInPath('tests/data/params'); $I->executeCommand('run --no-exit'); $I->seeInShellOutput('FAILURES'); $I->seeInShellOutput("Failed asserting that an array contains 'val1'"); }
public function startMyCommandWithOptionAndConfigurationAtNewPlace(CliGuy $I) { $myname = get_current_user(); $I->amInPath('tests/data/register_command'); $I->executeCommand('myProject:myCommand --config standard/codeception.yml --friendly'); $I->seeInShellOutput("Hello {$myname},"); $I->seeInShellOutput("how are you?"); }
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])}"); }
/** * @before moveToIncluded * @param CliGuy $I */ public function runIncludedWithCoverage(\CliGuy $I) { $I->executeCommand('run --coverage-xml'); $I->amInPath('_log'); $I->seeFileFound('coverage.xml'); $I->seeInThisFile('<class name="BillEvans" namespace="Jazz\\Pianist">'); $I->seeInThisFile('<class name="Musician" namespace="Jazz">'); $I->seeInThisFile('<class name="Hobbit" namespace="Shire">'); }
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 bootstrapWithNamespace(\CliGuy $I) { $I->amInPath('tests/data/sandbox/tests/_data/'); $I->executeCommand('bootstrap --namespace Generated'); $I->seeInShellOutput('Building Guy classes for suites'); $I->seeFileFound('codeception.yml'); $I->seeInThisFile('namespace: Generated'); $I->dontSeeInThisFile('namespace Generated\\'); $this->checkFilesCreated($I); $I->seeFileFound('WebHelper.php'); $I->seeInThisFile('namespace Generated\\Codeception\\Module;'); $I->seeFileFound('WebGuy.php'); $I->seeInThisFile('namespace Generated;'); }
public function environmentsFromSubfolders(CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run messages MessageCest.php:allMessages -vv --env env3'); $I->seeInShellOutput('MESSAGE2 FROM ENV3'); }
public function _before(CliGuy $I) { $I->amInPath(codecept_data_dir('sandbox')); }
/** * @after checkAllSuitesExecuted * @param CliGuy $I */ public function runIncludedSuites(\CliGuy $I) { $I->amInPath('tests/data/included_w'); $I->executeCommand('run'); }
function _before(\CliGuy $I) { $this->bootstrapPath = 'tests/data/sandbox/boot' . uniqid(); @mkdir($this->bootstrapPath, 0777, true); $I->amInPath($this->bootstrapPath); }
<?php $I = new CliGuy($scenario); $I->wantTo('delete dir with DeleteDirTask'); $I->amInPath(codecept_data_dir()); $I->seeFileFound('robo.txt', 'sandbox'); $I->taskDeleteDir(['sandbox/box'])->run(); $I->dontSeeFileFound('box', 'sandbox'); $I->dontSeeFileFound('robo.txt', 'sandbox');
public function _before(\CliGuy $I) { $I->amInPath('tests/data/sandbox'); }
<?php $I = new CliGuy($scenario); $I->wantTo('flatten dir with FlattenDir task'); $I->amInPath(codecept_data_dir() . 'sandbox'); $I->taskFlattenDir(['some/deeply/nested/*.re' => 'flattened', '*.txt' => 'flattened'])->run(); $I->seeDirFound('flattened'); $I->seeFileFound('structu.re', 'flattened'); $I->seeFileFound('a.txt', 'flattened'); $I->seeFileFound('b.txt', 'flattened');
public function checkBootstrapIsLoadedBeforeTests(CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run order ParsedLoadedTest.php'); $I->seeFileFound('order.txt', 'tests/_output'); $I->seeInThisFile('BIBP(T)'); }
<?php $I = new CliGuy($scenario); $I->wantTo('execute incomplete test'); $I->amInPath('tests/data/sandbox'); $I->executeCommand('run skipped IncompleteMeCept.php'); $I->seeInShellOutput("I IncompleteMeCept: Make it incomplete"); $I->seeInShellOutput('OK, but incomplete, skipped, or risky tests!');
<?php $I = new CliGuy($scenario); $I->wantTo('see that my group events fire only once'); $I->amInPath('tests/data/claypit'); $I->executeCommand('run dummy -g countevents -c codeception_grouped.yml'); $I->seeInShellOutput('Group Before Events: 1'); $I->dontSeeInShellOutput('Group Before Events: 2'); $I->seeInShellOutput('Group After Events: 1'); $I->dontSeeInShellOutput('Group After Events: 2');
public function runTestWithDataProviders(\CliGuy $I) { $I->amInPath('tests/data/sandbox'); $I->executeCommand('run tests/unit/DataProvidersTest.php'); $I->seeInShellOutput('Trying to test is triangle with data set "real triangle" (DataProvidersTest::testIsTriangle)'); $I->seeInShellOutput('Trying to test is triangle with data set #0 (DataProvidersTest::testIsTriangle)'); $I->seeInShellOutput('Trying to test is triangle with data set #1 (DataProvidersTest::testIsTriangle)'); $I->seeInShellOutput("OK"); }
public function checkParamsPassedInSelf(CliGuy $I) { $I->amInPath('tests/data/params'); $I->executeCommand('run -c codeception_self.yml'); $I->seeInShellOutput('OK (1 test'); }