Stud.IP  4.2 Revision
TestGuy Class Reference
Inheritance diagram for TestGuy:
Inheritance graph
Collaboration diagram for TestGuy:
Collaboration graph

Public Member Functions

 amInPath ($path)
 
 openFile ($filename)
 
 deleteFile ($filename)
 
 deleteDir ($dirname)
 
 copyDir ($src, $dst)
 
 canSeeInThisFile ($text)
 
 seeInThisFile ($text)
 
 canSeeFileContentsEqual ($text)
 
 seeFileContentsEqual ($text)
 
 cantSeeInThisFile ($text)
 
 dontSeeInThisFile ($text)
 
 deleteThisFile ()
 
 canSeeFileFound ($filename, $path=null)
 
 seeFileFound ($filename, $path=null)
 
 cantSeeFileFound ($filename, $path=null)
 
 dontSeeFileFound ($filename, $path=null)
 
 cleanDir ($dirname)
 
 writeToFile ($filename, $contents)
 

Detailed Description

Inherited Methods void wantToTest($text) void wantTo($text) void execute($callable) void expectTo($prediction) void expect($prediction) void amGoingTo($argumentation) void am($role) void lookForwardTo($achieveValue) void comment($description) void haveFriend($name, $actorClass = null)

Member Function Documentation

◆ amInPath()

amInPath (   $path)

[!] Method is generated. Documentation taken from corresponding module.

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

Parameters
$path
See also
::amInPath()

◆ canSeeFileContentsEqual()

canSeeFileContentsEqual (   $text)

[!] Method is generated. Documentation taken from corresponding module.

Checks 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');
?>
Parameters
$textConditional Assertion: Test won't be stopped on fail
See also
::seeFileContentsEqual()

◆ canSeeFileFound()

canSeeFileFound (   $filename,
  $path = null 
)

[!] Method is generated. Documentation taken from corresponding module.

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

<?php
$I->seeFileFound('UserModel.php','app/models');
?>
Parameters
$filename
string$pathConditional Assertion: Test won't be stopped on fail
See also
::seeFileFound()

◆ canSeeInThisFile()

canSeeInThisFile (   $text)

[!] Method is generated. Documentation taken from corresponding module.

Checks If opened file has text in it.

Usage:

<?php
$I->openFile('composer.json');
$I->seeInThisFile('codeception/codeception');
?>
Parameters
$textConditional Assertion: Test won't be stopped on fail
See also
::seeInThisFile()

◆ cantSeeFileFound()

cantSeeFileFound (   $filename,
  $path = null 
)

[!] Method is generated. Documentation taken from corresponding module.

Checks if file does not exists in path

Parameters
$filename
string$pathConditional Assertion: Test won't be stopped on fail
See also
::dontSeeFileFound()

◆ cantSeeInThisFile()

cantSeeInThisFile (   $text)

[!] Method is generated. Documentation taken from corresponding module.

Checks If opened file doesn't contain text in it

<?php
$I->openFile('composer.json');
$I->dontSeeInThisFile('codeception/codeception');
?>
Parameters
$textConditional Assertion: Test won't be stopped on fail
See also
::dontSeeInThisFile()

◆ cleanDir()

cleanDir (   $dirname)

[!] Method is generated. Documentation taken from corresponding module.

Erases directory contents

<?php
$I->cleanDir('logs');
?>
Parameters
$dirname
See also
::cleanDir()

◆ copyDir()

copyDir (   $src,
  $dst 
)

[!] Method is generated. Documentation taken from corresponding module.

Copies directory with all contents

<?php
$I->copyDir('vendor','old_vendor');
?>
Parameters
$src
$dst
See also
::copyDir()

◆ deleteDir()

deleteDir (   $dirname)

[!] Method is generated. Documentation taken from corresponding module.

Deletes directory with all subdirectories

<?php
$I->deleteDir('vendor');
?>
Parameters
$dirname
See also
::deleteDir()

◆ deleteFile()

deleteFile (   $filename)

[!] Method is generated. Documentation taken from corresponding module.

Deletes a file

<?php
$I->deleteFile('composer.lock');
?>
Parameters
$filename
See also
::deleteFile()

◆ deleteThisFile()

deleteThisFile ( )

[!] Method is generated. Documentation taken from corresponding module.

Deletes a file

See also
::deleteThisFile()

◆ dontSeeFileFound()

dontSeeFileFound (   $filename,
  $path = null 
)

[!] Method is generated. Documentation taken from corresponding module.

Checks if file does not exists in path

Parameters
$filename
string$path
See also
::dontSeeFileFound()

◆ dontSeeInThisFile()

dontSeeInThisFile (   $text)

[!] Method is generated. Documentation taken from corresponding module.

Checks If opened file doesn't contain text in it

<?php
$I->openFile('composer.json');
$I->dontSeeInThisFile('codeception/codeception');
?>
Parameters
$text
See also
::dontSeeInThisFile()

◆ openFile()

openFile (   $filename)

[!] Method is generated. Documentation taken from corresponding module.

Opens a file and stores it's content.

Usage:

<?php
$I->openFile('composer.json');
$I->seeInThisFile('codeception/codeception');
?>
Parameters
$filename
See also
::openFile()

◆ seeFileContentsEqual()

seeFileContentsEqual (   $text)

[!] Method is generated. Documentation taken from corresponding module.

Checks 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');
?>
Parameters
$text
See also
::seeFileContentsEqual()

◆ seeFileFound()

seeFileFound (   $filename,
  $path = null 
)

[!] Method is generated. Documentation taken from corresponding module.

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

<?php
$I->seeFileFound('UserModel.php','app/models');
?>
Parameters
$filename
string$path
See also
::seeFileFound()

◆ seeInThisFile()

seeInThisFile (   $text)

[!] Method is generated. Documentation taken from corresponding module.

Checks If opened file has text in it.

Usage:

<?php
$I->openFile('composer.json');
$I->seeInThisFile('codeception/codeception');
?>
Parameters
$text
See also
::seeInThisFile()

◆ writeToFile()

writeToFile (   $filename,
  $contents 
)

[!] Method is generated. Documentation taken from corresponding module.

Saves contents to file

Parameters
$filename
$contents
See also
::writeToFile()

The documentation for this class was generated from the following file: