assertStringEqualsFile() public static method

Asserts that the contents of a string is equal to the contents of a file.
public static assertStringEqualsFile ( string $expectedFile, string $actualString, string $message = '', boolean $canonicalize = false, boolean $ignoreCase = false )
$expectedFile string
$actualString string
$message string
$canonicalize boolean
$ignoreCase boolean
Example #1
0
/**
 * Asserts that the contents of a string is equal
 * to the contents of a file.
 *
 * @param  string  $expectedFile
 * @param  string  $actualString
 * @param  string  $message
 * @param  boolean $canonicalize
 * @param  boolean $ignoreCase
 * @since  Method available since Release 3.3.0
 */
function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
{
    return PHPUnit_Framework_Assert::assertStringEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
}
Example #2
0
 public function isEqualToFile($file)
 {
     Assert::assertStringEqualsFile($file, $this->actual, $this->description);
     return $this;
 }
Example #3
0
 /**
  * Expect that the contents of one file or a string is equal to the contents of another file.
  *
  * @param string $expected
  * @param string $message
  * @param bool $canonicalize
  * @param bool $ignoreCase
  *
  * @return Expect
  */
 public function toEqualFile($expected, $message = '', $canonicalize = false, $ignoreCase = false)
 {
     if (file_exists($this->value)) {
         // file
         Assert::assertFileEquals($expected, $this->value, $message, $canonicalize, $ignoreCase);
     } else {
         // string
         Assert::assertStringEqualsFile($expected, $this->value, $message, $canonicalize, $ignoreCase);
     }
     return $this;
 }
Example #4
0
 public function equalsFile($file)
 {
     a::assertStringEqualsFile($file, $this->actual, $this->description);
 }
Example #5
0
 /**
  * Asserts that the contents of a string is equal
  * to the contents of a vfs file.
  *
  * @param $expectedFile
  * @param $actualString
  * @param string $message
  * @param bool|false $canonicalize
  * @param bool|false $ignoreCase
  */
 public function assertStringEqualsVfsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
 {
     PHPUnit::assertStringEqualsFile($expectedFile, $actualString, $message, $canonicalize, $ignoreCase);
 }