GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — codeception.github.com/docs1/modules/Filesystem.markdown at master · splinter89/codeception.github.com

Expand file tree

/

Filesystem.markdown

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
199 lines (106 loc) · 2.49 KB
/

Filesystem.markdown

Copy path

File metadata and controls

199 lines (106 loc) · 2.49 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
layout doc
title Filesystem Module - Codeception - Documentation

Filesystem Module

For additional reference, please review the source

Module for testing local filesystem. Fork it to extend the module for FTP, Amazon S3, others.

Status

  • Maintainer: davert
  • Stability: stable
  • Contact: [email protected]

Module was developed to test Codeception itself.

Actions

amInPath

Enters a directory In local filesystem. Project root directory is used by default

  • param $path

cleanDir

Erases directory contents

{% highlight php %}

cleanDir('logs'); ?>

{% endhighlight %}

  • param $dirname

copyDir

Copies directory with all contents

{% highlight php %}

copyDir('vendor','old_vendor'); ?>

{% endhighlight %}

  • param $src
  • param $dst

deleteDir

Deletes directory with all subdirectories

{% highlight php %}

deleteDir('vendor'); ?>

{% endhighlight %}

  • param $dirname

deleteFile

Deletes a file

{% highlight php %}

deleteFile('composer.lock'); ?>

{% endhighlight %}

  • param $filename

deleteThisFile

Deletes a file

dontSeeInThisFile

Checks If opened file doesn't contain text in it

{% highlight php %}

openFile('composer.json'); $I->dontSeeInThisFile('codeception/codeception'); ?>

{% endhighlight %}

  • param $text

getName

not documented

openFile

Opens a file and stores it's content.

Usage:

{% highlight php %}

openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>

{% endhighlight %}

  • param $filename

seeFileContentsEqual

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 %}

  • param $text

seeFileFound

Checks if file exists in path. Opens a file when it's exists

{% highlight php %}

seeFileFound('UserModel.php','app/models'); ?>

{% endhighlight %}

  • param $filename
  • param string $path

seeInThisFile

Checks If opened file has text in it.

Usage:

{% highlight php %}

openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>

{% endhighlight %}

  • param $text
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.