StringCompareTrait
Compare a string to the contents of a file
Implementing objects are expected to modify the $_compareBasePath
property
before use.
Table of Contents
Properties
- $_compareBasePath : string
- The base path for output comparisons
- $_updateComparisons : bool
- Update comparisons to match test changes
Methods
- assertSameAsFile() : void
- Compare the result to the contents of the file
Properties
$_compareBasePath
The base path for output comparisons
protected
string
$_compareBasePath
= ''
Must be initialized before use
$_updateComparisons
Update comparisons to match test changes
protected
bool
$_updateComparisons
Initialized with the env variable UPDATE_TEST_COMPARISON_FILES
Methods
assertSameAsFile()
Compare the result to the contents of the file
public
assertSameAsFile(string $path, string $result) : void
Parameters
- $path : string
-
partial path to test comparison file
- $result : string
-
test result as a string