public function equals($expected) { if (!$this->isFileExpectation) { a::assertEquals($expected, $this->actual, $this->description); } else { a::assertFileEquals($expected, $this->actual, $this->description); } }
/** * 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); }
/** * 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; }
/** * 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); }
public function isEqualTo($file) { Assert::assertFileEquals($file, $this->actual, $this->description); return $this; }