From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- .../includes/api/format/ApiFormatWddxTest.php | 80 ---------------------- 1 file changed, 80 deletions(-) delete mode 100644 tests/phpunit/includes/api/format/ApiFormatWddxTest.php (limited to 'tests/phpunit/includes/api/format/ApiFormatWddxTest.php') diff --git a/tests/phpunit/includes/api/format/ApiFormatWddxTest.php b/tests/phpunit/includes/api/format/ApiFormatWddxTest.php deleted file mode 100644 index 07111300..00000000 --- a/tests/phpunit/includes/api/format/ApiFormatWddxTest.php +++ /dev/null @@ -1,80 +0,0 @@ - true ) ) - ); - } - return self::provideEncoding(); - } - - public static function provideEncoding() { - $p = '
format=wddx has been deprecated. Please use format=json instead.'; - $s = ''; - - return array( - // Basic types - array( array( null ), "{$p}{$s}" ), - array( array( true ), "{$p}{$s}" ), - array( array( false ), "{$p}{$s}" ), - array( array( true, ApiResult::META_BC_BOOLS => array( 0 ) ), - "{$p}{$s}" ), - array( array( false, ApiResult::META_BC_BOOLS => array( 0 ) ), - "{$p}{$s}" ), - array( array( 42 ), "{$p}42{$s}" ), - array( array( 42.5 ), "{$p}42.5{$s}" ), - array( array( 1e42 ), "{$p}1.0E+42{$s}" ), - array( array( 'foo' ), "{$p}foo{$s}" ), - array( array( 'fóo' ), "{$p}fóo{$s}" ), - - // Arrays and objects - array( array( array() ), "{$p}{$s}" ), - array( array( array( 1 ) ), "{$p}1{$s}" ), - array( array( array( 'x' => 1 ) ), "{$p}1{$s}" ), - array( array( array( 2 => 1 ) ), "{$p}1{$s}" ), - array( array( (object)array() ), "{$p}{$s}" ), - array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "{$p}1{$s}" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "{$p}1{$s}" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "{$p}1{$s}" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ), - "{$p}x1{$s}" ), - array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "{$p}1{$s}" ), - array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "{$p}ab{$s}" ), - - // Content - array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ), - "{$p}foo{$s}" ), - - // BC Subelements - array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ), - "{$p}foo{$s}" ), - ); - } - - /** - * @dataProvider provideEncoding - */ - public function testSlowEncoding( array $data, $expect, array $params = array() ) { - // Adjust expectation for differences between fast and slow printers. - $expect = str_replace( '\'', '"', $expect ); - $expect = str_replace( '/>', ' />', $expect ); - $expect = '' . $expect; - - $this->assertSame( $expect, $this->encodeData( $params, $data, 'ApiFormatWddxTest_SlowWddx' ) ); - } -} - -class ApiFormatWddxTest_SlowWddx extends ApiFormatWddx { - public static function useSlowPrinter() { - return true; - } -} -- cgit v1.2.3-54-g00ecf