Trait StringCompareTrait

Compare a string to the contents of a file

Implementing objects are expected to modify the $_compareBasePath property before use.

Namespace: Cake\TestSuite

Properties summary

Method Summary

Method Detail

assertSameAsFile() public

assertSameAsFile(mixed $path, mixed $result)

Compare the result to the contents of the file

Parameters

string $path

partial path to test comparison file

string $result

test result as a string

Property Detail

$_compareBasePath protected

The base path for output comparisons

Must be initialized before use

Type

string

$_updateComparisons protected

Update comparisons to match test changes

Initialized with the env variable UPDATE_TEST_COMPARISON_FILES

Type

bool

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.9/trait-Cake.TestSuite.StringCompareTrait.html