assertJsonStringEqualsJsonFile() 공개 정적인 메소드

Asserts that the generated JSON encoded object and the content of the given file are equal.
public static assertJsonStringEqualsJsonFile ( string $expectedFile, string $actualJson, string $message = '' )
$expectedFile string
$actualJson string
$message string
예제 #1
0
 public function isEqualToJsonFile($file)
 {
     Assert::assertJsonStringEqualsJsonFile($file, $this->actual, $this->description);
     return $this;
 }
예제 #2
0
 public function equalsJsonFile($file)
 {
     if (!$this->isFileExpectation) {
         a::assertJsonStringEqualsJsonFile($file, $this->actual, $this->description);
     } else {
         a::assertJsonFileEqualsJsonFile($file, $this->actual, $this->description);
     }
 }
예제 #3
0
/**
 * 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 = '');
}
예제 #4
0
 /**
  * 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;
 }
예제 #5
0
 /**
  * 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);
 }