Module for testing local filesystem.
Fork it to extend the module for FTP, Amazon S3, others.
Module was developed to test Codeception itself.
Enters a directory In local filesystem.
Project root directory is used by default
param string
$pathErases directory contents
<?php
$I->cleanDir('logs');
?>
param string
$dirnameCopies directory with all contents
<?php
$I->copyDir('vendor','old_vendor');
?>
param string
$srcparam string
$dstDeletes directory with all subdirectories
<?php
$I->deleteDir('vendor');
?>
param string
$dirnameDeletes a file
<?php
$I->deleteFile('composer.lock');
?>
param string
$filenameDeletes a file
Checks if file does not exist in path
param string
$filenameparam string
$pathChecks If opened file doesn't contain text
in it
<?php
$I->openFile('composer.json');
$I->dontSeeInThisFile('codeception/codeception');
?>
param string
$textOpens a file and stores it's content.
Usage:
<?php
$I->openFile('composer.json');
$I->seeInThisFile('codeception/codeception');
?>
param string
$filenameChecks the strict matching of file contents.
Unlike seeInThisFile
will fail if file has something more than expected lines.
Better to use with HEREDOC strings.
Matching is done after removing "\r" chars from file content.
<?php
$I->openFile('process.pid');
$I->seeFileContentsEqual('3192');
?>
param string
$textChecks if file exists in path.
Opens a file when it's exists
<?php
$I->seeFileFound('UserModel.php','app/models');
?>
param string
$filenameparam string
$pathChecks If opened file has text
in it.
Usage:
<?php
$I->openFile('composer.json');
$I->seeInThisFile('codeception/codeception');
?>
param string
$textChecks If opened file has the number
of new lines.
Usage:
<?php
$I->openFile('composer.json');
$I->seeNumberNewLines(5);
?>
param int
$number New linesChecks that contents of currently opened file matches $regex
param string
$regexSaves contents to file
param string
$filenameparam string
$contents