public function testArray( $data, $expect ) {
if ( $expect === true ) {
$ret = MWRestrictions::newFromArray( $data );
public function testArray( $data, $expect ) {
if ( $expect === true ) {
$ret = MWRestrictions::newFromArray( $data );
public function testJson( $json, $expect ) {
if ( is_array( $expect ) ) {
$ret = MWRestrictions::newFromJson( $json );
public function testJson( $json, $expect ) {
if ( is_array( $expect ) ) {
$ret = MWRestrictions::newFromJson( $json );
$this->assertSame( $expect, $ret->toArray() );
$this->assertSame( $json, $ret->toJson( false ) );
$this->assertSame( $expect, $ret->toArray() );
$this->assertSame( $json, $ret->toJson( false ) );