| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| layout | doc |
|---|---|
| title | Filesystem Module - Codeception - Documentation |
For additional reference, please review the source
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
Erases directory contents
{% highlight php %}
cleanDir('logs'); ?>{% endhighlight %}
Copies directory with all contents
{% highlight php %}
copyDir('vendor','old_vendor'); ?>{% endhighlight %}
Deletes directory with all subdirectories
{% highlight php %}
deleteDir('vendor'); ?>{% endhighlight %}
Deletes a file
{% highlight php %}
deleteFile('composer.lock'); ?>{% endhighlight %}
Deletes a file
Checks if file does not exists in path
Checks If opened file doesn't contain text in it
{% highlight php %}
openFile('composer.json'); $I->dontSeeInThisFile('codeception/codeception'); ?>{% endhighlight %}
Opens a file and stores it's content.
Usage:
{% highlight php %}
openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>{% endhighlight %}
Checks the strict matching of file contents. Unlike seeInThisFile will fail if file has something more then expected lines. Better to use with HEREDOC strings. Matching is done after removing "\r" chars from file content.
{% highlight php %}
openFile('process.pid'); $I->seeFileContentsEqual('3192'); ?>{% endhighlight %}
Checks if file exists in path. Opens a file when it's exists
{% highlight php %}
seeFileFound('UserModel.php','app/models'); ?>{% endhighlight %}
Checks If opened file has text in it.
Usage:
{% highlight php %}
openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>{% endhighlight %}
Saves contents to file
| Back | FazBrowse Home | New Git URL |