Exemplo n.º 1
0
 public function bootstrapEmpty(\CliGuy $I)
 {
     $I->executeCommand('bootstrap --empty');
     $I->dontSeeFileFound('tests/acceptance');
     $I->dontSeeFileFound('AcceptanceTester.php', 'tests/acceptance');
     $I->seeFileFound('codeception.yml');
 }
Exemplo n.º 2
0
 public function toTestCrossVolumeRename(CliGuy $I)
 {
     $fsStack = $I->taskFilesystemStack()->mkdir('log')->touch('log/error.txt');
     $fsStack->run();
     // We can't force _rename to run the cross-volume
     // code path, so we will directly call the protected
     // method crossVolumeRename to test to ensure it works.
     // We will get a reference to it via reflection, set
     // the reflected method object to public, and then
     // call it via reflection.
     $class = new ReflectionClass('\\Robo\\Task\\Filesystem\\FilesystemStack');
     $method = $class->getMethod('crossVolumeRename');
     $method->setAccessible(true);
     $actualFsStackTask = $fsStack->getCollectionBuilderCurrentTask();
     $method->invokeArgs($actualFsStackTask, ['log', 'logfiles']);
     $I->dontSeeFileFound('log/error.txt');
     $I->seeFileFound('logfiles/error.txt');
 }
Exemplo n.º 3
0
    public function runWithCustomOuptutPath(\CliGuy $I)
    {
        $I->executeCommand('run dummy --xml myverycustom.xml --html myownhtmlreport.html');
        $I->seeFileFound('myverycustom.xml', 'tests/_log');
        $I->seeInThisFile('<?xml');
        $I->seeInThisFile('<testsuite name="dummy"');
        $I->seeInThisFile('<testcase name="FileExists"');
        $I->seeFileFound('myownhtmlreport.html', 'tests/_log');
        $I->dontSeeFileFound('report.xml','tests/_log');
        $I->dontSeeFileFound('report.html','tests/_log');

    }
Exemplo n.º 4
0
<?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');
Exemplo n.º 5
0
 public function toDeleteFile(CliGuy $I)
 {
     $I->taskFileSystemStack()->stopOnFail()->remove('a.txt')->run();
     $I->dontSeeFileFound('a.txt');
 }