<?php

$I = new CliGuy\GeneratorSteps($scenario);
$I->wantTo('generate new group');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:group core');
$I->seeFileWithGeneratedClass('CoreGroup', 'tests/_groups');
$I->seeInThisFile("static \$group = 'core'");
$I->dontSeeInThisFile('public function _before(\\Codeception\\Event\\Test \\$e)');
$I->seeFileFound('tests/_bootstrap.php');
$I->seeInThisFile("\\Codeception\\Util\\Autoload::registerSuffix('Group', __DIR__.DIRECTORY_SEPARATOR.'_groups'");
示例#2
0
<?php

$I = new CliGuy\GeneratorSteps($scenario);
$I->wantTo('generate sample Cest');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:cest dummy DummyClass');
$I->seeFileWithGeneratedClass('DummyClass');
<?php

$I = new CliGuy\GeneratorSteps($scenario);
$I->wantTo('generate helper');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:helper Db');
$I->seeFileWithGeneratedClass('Db', 'tests/_support/Helper');
$I->seeInThisFile('Db extends \\Codeception\\Module');
<?php

$I = new CliGuy\GeneratorSteps($scenario);
$I->wantTo('generate step object');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:stepobject dummy Login --silent');
$I->seeFileWithGeneratedClass('LoginSteps', 'tests/dummy/_steps');
$I->seeInThisFile('LoginSteps extends \\DumbGuy');
$I->seeAutoloaderWasAdded('Steps', 'tests/dummy');