Refactoring
This commit is contained in:
34
lib/composer/vendor/consolidation/robo/tests/cli/SimulatedCest.php
vendored
Normal file
34
lib/composer/vendor/consolidation/robo/tests/cli/SimulatedCest.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace Robo;
|
||||
|
||||
use \CliGuy;
|
||||
|
||||
use Robo\Contract\TaskInterface;
|
||||
use Robo\Collection\Temporary;
|
||||
use Robo\Result;
|
||||
|
||||
class SimulatedCest
|
||||
{
|
||||
public function _before(CliGuy $I)
|
||||
{
|
||||
$I->amInPath(codecept_data_dir().'sandbox');
|
||||
}
|
||||
|
||||
public function toSimulateDirCreation(CliGuy $I)
|
||||
{
|
||||
// Set up a collection to add tasks to
|
||||
$collection = $I->collectionBuilder();
|
||||
$collection->simulated(true);
|
||||
|
||||
// Set up a filesystem stack
|
||||
$collection->taskFilesystemStack()
|
||||
->mkdir('simulatedir')
|
||||
->touch('simulatedir/error.txt');
|
||||
|
||||
// Run the task collection; now the files should be present
|
||||
$collection->run();
|
||||
// Nothing should be created in simulated mode
|
||||
$I->dontSeeFileFound('simulatedir/error.txt');
|
||||
$I->seeInOutput('[Simulator] Simulating Filesystem\FilesystemStack()');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user