assertFileEquals() public static method

Asserts that the contents of one file is equal to the contents of another file.
public static assertFileEquals ( string $expected, string $actual, string $message = '', boolean $canonicalize = false, boolean $ignoreCase = false )
$expected string
$actual string
$message string
$canonicalize boolean
$ignoreCase boolean
Ejemplo n.º 1
0
 public function equals($expected)
 {
     if (!$this->isFileExpectation) {
         a::assertEquals($expected, $this->actual, $this->description);
     } else {
         a::assertFileEquals($expected, $this->actual, $this->description);
     }
 }
Ejemplo n.º 2
0
/**
 * Asserts that the contents of one file is equal to the contents of another
 * file.
 *
 * @param  string  $expected
 * @param  string  $actual
 * @param  string  $message
 * @param  boolean $canonicalize
 * @param  boolean $ignoreCase
 * @since  Method available since Release 3.2.14
 */
function assertFileEquals($expected, $actual, $message = '', $canonicalize = FALSE, $ignoreCase = FALSE)
{
    return PHPUnit_Framework_Assert::assertFileEquals($expected, $actual, $message, $canonicalize, $ignoreCase);
}
 /**
  * @Then file :arg1 should match :arg2
  */
 public function fileShouldMatch($file, $expected)
 {
     \PHPUnit_Framework_Assert::assertFileEquals($expected, $file);
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
 /**
  * Asserts that the contents of one vfs file is equal to the contents of another
  * vfs file.
  *
  * @param $expected
  * @param $actual
  * @param string $message
  * @param bool|false $canonicalize
  * @param bool|false $ignoreCase
  */
 public function assertVfsFileEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
 {
     PHPUnit::assertFileEquals($this->getPath($expected), $this->getPath($actual), $message, $canonicalize, $ignoreCase);
 }
Ejemplo n.º 6
0
 public function isEqualTo($file)
 {
     Assert::assertFileEquals($file, $this->actual, $this->description);
     return $this;
 }