PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString PHP Method

assertJsonStringNotEqualsJsonString() public static method

Asserts that two given JSON encoded objects or arrays are not equal.
public static assertJsonStringNotEqualsJsonString ( string $expectedJson, string $actualJson, string $message = '' )
$expectedJson string
$actualJson string
$message string
    public static function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, $message = '')
    {
        static::assertJson($expectedJson, $message);
        static::assertJson($actualJson, $message);
        $expected = json_decode($expectedJson);
        $actual = json_decode($actualJson);
        static::assertNotEquals($expected, $actual, $message);
    }

Usage Example

Example #1
0
 /**
  * Expect that two given JSON encoded objects or arrays are not equal.
  *
  * @param string $expectedJson
  * @param string $message
  *
  * @return Expect
  */
 public function notToEqualJson($expectedJson, $message = '')
 {
     Assert::assertJsonStringNotEqualsJsonString($expectedJson, $this->value, $message);
     return $this;
 }
All Usage Examples Of PHPUnit_Framework_Assert::assertJsonStringNotEqualsJsonString
PHPUnit_Framework_Assert