/** * @dataProvider provideRoundTripObjects */ public function testJsonRoundTrip(PageIdentifier $identifierObject) { $json = $identifierObject->jsonSerialize(); $this->assertEquals($identifierObject, PageIdentifier::jsonDeserialize($json)); }
/** * @param array $json * * @return self */ public static function jsonDeserialize($json) { return new self($json['id'], $json['type'], $json['action'], $json['timestamp'], $json['user'], PageIdentifier::jsonDeserialize($json['pageidentifier']), $json['comment'], $json['details']); }