public function isEqualToJsonFile($file) { Assert::assertJsonStringEqualsJsonFile($file, $this->actual, $this->description); return $this; }
public function equalsJsonFile($file) { if (!$this->isFileExpectation) { a::assertJsonStringEqualsJsonFile($file, $this->actual, $this->description); } else { a::assertJsonFileEqualsJsonFile($file, $this->actual, $this->description); } }
/** * Asserts that the generated JSON encoded object and the content of the given file are equal. * * @param string $expectedFile * @param string $actualJson * @param string $message * @since Method available since Release 3.7.0 */ function assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = '') { return PHPUnit_Framework_Assert::assertJsonStringEqualsJsonFile($expectedFile, $actualJson, $message = ''); }
/** * Expect that the generated JSON encoded object and the content of the given file or JSON string are equal. * * @param string $expectedFile * @param string $message * * @return Expect */ public function toEqualJsonFile($expectedFile, $message = '') { if (file_exists($this->value)) { // file Assert::assertJsonFileEqualsJsonFile($expectedFile, $this->value, $message); } else { // string Assert::assertJsonStringEqualsJsonFile($expectedFile, $this->value, $message); } return $this; }
/** * Asserts that the generated JSON encoded object and the content of the given vfs file are equal. * * @param $expectedFile * @param $actualJson * @param string $message */ public function assertJsonStringEqualsVfsJsonFile($expectedFile, $actualJson, $message = '') { PHPUnit::assertJsonStringEqualsJsonFile($this->getPath($expectedFile), $actualJson, $message); }