Documentation

FileEqualsTextFile extends Constraint
in package

FinalYes

Compares two text files line-by-line.

The expected file is passed to the constructor. The actual value passed to Constraint::evaluate() may be a SplFileInfo or a path string. File contents are read with PHP's file() function using the constructor's options, which can be used for text-oriented normalization such as FILE_IGNORE_NEW_LINES.

Table of Contents

Methods

__construct()  : mixed
evaluate()  : bool
toString()  : string

Methods

__construct()

public __construct(SplFileInfo|string $file[, int $options = 0 ]) : mixed
Parameters
$file : SplFileInfo|string
$options : int = 0

same options as PHP's file() function

Tags
phpstan-param

int-mask<FILE_USE_INCLUDE_PATH, FILE_IGNORE_NEW_LINES, FILE_SKIP_EMPTY_LINES, FILE_NO_DEFAULT_CONTEXT> $options

evaluate()

public evaluate(mixed $other[, string $description = '' ][, bool $returnResult = false ]) : bool
Parameters
$other : mixed
$description : string = ''
$returnResult : bool = false
Return values
bool
On this page

Search results