API: Remove WDDX and dump formats
authorMax Semenik <maxsem.wiki@gmail.com>
Fri, 10 Apr 2015 16:34:11 +0000 (19:34 +0300)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 1 Jul 2015 15:43:39 +0000 (11:43 -0400)
Per RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Ditch_crappy_API_formats

Change-Id: I4c9e64875be509906021255d70b90688f2e5ddf3

RELEASE-NOTES-1.26
autoload.php
includes/api/ApiFormatBase.php
includes/api/ApiFormatDump.php [deleted file]
includes/api/ApiFormatWddx.php [deleted file]
includes/api/ApiMain.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json
tests/phpunit/includes/api/format/ApiFormatDumpTest.php [deleted file]
tests/phpunit/includes/api/format/ApiFormatWddxTest.php [deleted file]

index 5675956..aed6de9 100644 (file)
@@ -14,6 +14,7 @@ production.
 * New-style continuation is now the default for API action=continue. Clients may
   use the 'rawcontinue' parameter to receive raw query-continue data, but the
   new style is encouraged as it's harder to implement incorrectly.
+* Deprecated API formats dump and wddx have been completely removed.
 
 === New features in 1.26 ===
 * (T51506) Now action=info gives estimates of actual watchers for a page.
@@ -55,6 +56,7 @@ production.
 * New-style continuation is now the default for action=continue. Clients may
   use the 'rawcontinue' parameter to receive raw query-continue data, but the
   new style is encouraged as it's harder to implement incorrectly.
+* Deprecated API formats dump and wddx have been completely removed.
 * API action=query&list=tags: The displayname can now be boolean false if the
   tag is meant to be hidden from user interfaces.
 * action=import no longer allows both the namespace= and rootpage= parameters
index 9266776..8e4da1e 100644 (file)
@@ -37,14 +37,12 @@ $wgAutoloadLocalClasses = array(
        'ApiFileRevert' => __DIR__ . '/includes/api/ApiFileRevert.php',
        'ApiFormatBase' => __DIR__ . '/includes/api/ApiFormatBase.php',
        'ApiFormatDbg' => __DIR__ . '/includes/api/ApiFormatDbg.php',
-       'ApiFormatDump' => __DIR__ . '/includes/api/ApiFormatDump.php',
        'ApiFormatFeedWrapper' => __DIR__ . '/includes/api/ApiFormatFeedWrapper.php',
        'ApiFormatJson' => __DIR__ . '/includes/api/ApiFormatJson.php',
        'ApiFormatNone' => __DIR__ . '/includes/api/ApiFormatNone.php',
        'ApiFormatPhp' => __DIR__ . '/includes/api/ApiFormatPhp.php',
        'ApiFormatRaw' => __DIR__ . '/includes/api/ApiFormatRaw.php',
        'ApiFormatTxt' => __DIR__ . '/includes/api/ApiFormatTxt.php',
-       'ApiFormatWddx' => __DIR__ . '/includes/api/ApiFormatWddx.php',
        'ApiFormatXml' => __DIR__ . '/includes/api/ApiFormatXml.php',
        'ApiFormatXmlRsd' => __DIR__ . '/includes/api/ApiRsd.php',
        'ApiFormatYaml' => __DIR__ . '/includes/api/ApiFormatYaml.php',
index 47c8128..4d80163 100644 (file)
@@ -246,7 +246,7 @@ abstract class ApiFormatBase extends ApiBase {
        }
 
        /**
-        * To avoid code duplication with the deprecation of dbg, dump, txt, wddx,
+        * To avoid code duplication with the deprecation of dbg, txt
         * and yaml, this method is added to do the necessary work. It should be
         * removed when those deprecated formats are removed.
         */
@@ -312,7 +312,7 @@ abstract class ApiFormatBase extends ApiBase {
                // Escape everything first for full coverage
                $text = htmlspecialchars( $text );
 
-               if ( $this->mFormat === 'XML' || $this->mFormat === 'WDDX' ) {
+               if ( $this->mFormat === 'XML' ) {
                        // encode all comments or tags as safe blue strings
                        $text = str_replace( '&lt;', '<span style="color:blue;">&lt;', $text );
                        $text = str_replace( '&gt;', '&gt;</span>', $text );
diff --git a/includes/api/ApiFormatDump.php b/includes/api/ApiFormatDump.php
deleted file mode 100644 (file)
index f34e1ae..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-/**
- *
- *
- * Created on August 8, 2010
- *
- * Copyright © 2010 Soxred93
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-/**
- * API PHP's var_dump() output formatter
- * @deprecated since 1.24
- * @ingroup API
- */
-class ApiFormatDump extends ApiFormatBase {
-
-       public function getMimeType() {
-               // This looks like it should be text/plain, but IE7 is so
-               // brain-damaged it tries to parse text/plain as HTML if it
-               // contains HTML tags. Using MIME text/text works around this bug
-               return 'text/text';
-       }
-
-       public function execute() {
-               $this->markDeprecated();
-               $data = $this->getResult()->getResultData( null, array(
-                       'BC' => array(),
-                       'Types' => array(),
-                       'Strip' => 'all',
-               ) );
-               ob_start();
-               var_dump( $data );
-               $result = ob_get_contents();
-               ob_end_clean();
-               $this->printText( $result );
-       }
-
-       public function isDeprecated() {
-               return true;
-       }
-}
diff --git a/includes/api/ApiFormatWddx.php b/includes/api/ApiFormatWddx.php
deleted file mode 100644 (file)
index c18353f..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-/**
- *
- *
- * Created on Oct 22, 2006
- *
- * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-/**
- * API WDDX output formatter
- * @deprecated since 1.24
- * @ingroup API
- */
-class ApiFormatWddx extends ApiFormatBase {
-
-       public function getMimeType() {
-               return 'text/xml';
-       }
-
-       public function execute() {
-               $this->markDeprecated();
-
-               $data = $this->getResult()->getResultData( null, array(
-                       'BC' => array(),
-                       'Types' => array( 'AssocAsObject' => true ),
-                       'Strip' => 'all',
-               ) );
-
-               if ( !$this->getIsHtml() && !static::useSlowPrinter() ) {
-                       $txt = wddx_serialize_value( $data );
-                       $txt = str_replace(
-                               '<struct><var name=\'php_class_name\'><string>stdClass</string></var>',
-                               '<struct>',
-                               $txt
-                       );
-                       $this->printText( $txt );
-               } else {
-                       // Don't do newlines and indentation if we weren't asked
-                       // for pretty output
-                       $nl = ( $this->getIsHtml() ? "\n" : '' );
-                       $indstr = ( $this->getIsHtml() ? ' ' : '' );
-                       $this->printText( "<?xml version=\"1.0\"?>$nl" );
-                       $this->printText( "<wddxPacket version=\"1.0\">$nl" );
-                       $this->printText( "$indstr<header />$nl" );
-                       $this->printText( "$indstr<data>$nl" );
-                       $this->slowWddxPrinter( $data, 4 );
-                       $this->printText( "$indstr</data>$nl" );
-                       $this->printText( "</wddxPacket>$nl" );
-               }
-       }
-
-       public static function useSlowPrinter() {
-               if ( !function_exists( 'wddx_serialize_value' ) ) {
-                       return true;
-               }
-
-               // Some versions of PHP have a broken wddx_serialize_value, see
-               // PHP bug 45314. Test encoding an affected character (U+00A0)
-               // to avoid this.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><string>\xc2\xa0</string></data></wddxPacket>";
-               if ( wddx_serialize_value( "\xc2\xa0" ) !== $expected ) {
-                       return true;
-               }
-
-               // Some versions of HHVM don't correctly encode ampersands.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><string>&amp;</string></data></wddxPacket>";
-               if ( wddx_serialize_value( '&' ) !== $expected ) {
-                       return true;
-               }
-
-               // Some versions of HHVM don't correctly encode empty arrays as subvalues.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><array length='1'><array length='0'></array></array></data></wddxPacket>";
-               if ( wddx_serialize_value( array( array() ) ) !== $expected ) {
-                       return true;
-               }
-
-               // Some versions of HHVM don't correctly encode associative arrays with numeric keys.
-               $expected =
-                       "<wddxPacket version='1.0'><header/><data><struct><var name='2'><number>1</number></var></struct></data></wddxPacket>";
-               if ( wddx_serialize_value( array( 2 => 1 ) ) !== $expected ) {
-                       return true;
-               }
-
-               return false;
-       }
-
-       /**
-        * Recursively go through the object and output its data in WDDX format.
-        * @param mixed $elemValue
-        * @param int $indent
-        */
-       function slowWddxPrinter( $elemValue, $indent = 0 ) {
-               $indstr = ( $this->getIsHtml() ? str_repeat( ' ', $indent ) : '' );
-               $indstr2 = ( $this->getIsHtml() ? str_repeat( ' ', $indent + 2 ) : '' );
-               $nl = ( $this->getIsHtml() ? "\n" : '' );
-
-               if ( is_array( $elemValue ) ) {
-                       $cnt = count( $elemValue );
-                       if ( $cnt != 0 && array_keys( $elemValue ) !== range( 0, $cnt - 1 ) ) {
-                               $elemValue = (object)$elemValue;
-                       }
-               }
-
-               if ( is_array( $elemValue ) ) {
-                       // Regular array
-                       $this->printText( $indstr . Xml::element( 'array', array(
-                               'length' => count( $elemValue ) ), null ) . $nl );
-                       foreach ( $elemValue as $subElemValue ) {
-                               $this->slowWddxPrinter( $subElemValue, $indent + 2 );
-                       }
-                       $this->printText( "$indstr</array>$nl" );
-               } elseif ( is_object( $elemValue ) ) {
-                       // Associative array (<struct>)
-                       $this->printText( "$indstr<struct>$nl" );
-                       foreach ( $elemValue as $subElemName => $subElemValue ) {
-                               $this->printText( $indstr2 . Xml::element( 'var', array(
-                                       'name' => $subElemName
-                               ), null ) . $nl );
-                               $this->slowWddxPrinter( $subElemValue, $indent + 4 );
-                               $this->printText( "$indstr2</var>$nl" );
-                       }
-                       $this->printText( "$indstr</struct>$nl" );
-               } elseif ( is_int( $elemValue ) || is_float( $elemValue ) ) {
-                       $this->printText( $indstr . Xml::element( 'number', null, $elemValue ) . $nl );
-               } elseif ( is_string( $elemValue ) ) {
-                       $this->printText( $indstr . Xml::element( 'string', null, $elemValue, false ) . $nl );
-               } elseif ( is_bool( $elemValue ) ) {
-                       $this->printText( $indstr . Xml::element( 'boolean',
-                               array( 'value' => $elemValue ? 'true' : 'false' ) ) . $nl
-                       );
-               } elseif ( $elemValue === null ) {
-                       $this->printText( $indstr . Xml::element( 'null', array() ) . $nl );
-               } else {
-                       ApiBase::dieDebug( __METHOD__, 'Unknown type ' . gettype( $elemValue ) );
-               }
-       }
-
-       public function isDeprecated() {
-               return true;
-       }
-}
index a8db20c..f2059d7 100644 (file)
@@ -100,8 +100,6 @@ class ApiMain extends ApiBase {
                'jsonfm' => 'ApiFormatJson',
                'php' => 'ApiFormatPhp',
                'phpfm' => 'ApiFormatPhp',
-               'wddx' => 'ApiFormatWddx',
-               'wddxfm' => 'ApiFormatWddx',
                'xml' => 'ApiFormatXml',
                'xmlfm' => 'ApiFormatXml',
                'yaml' => 'ApiFormatYaml',
@@ -111,8 +109,6 @@ class ApiMain extends ApiBase {
                'txtfm' => 'ApiFormatTxt',
                'dbg' => 'ApiFormatDbg',
                'dbgfm' => 'ApiFormatDbg',
-               'dump' => 'ApiFormatDump',
-               'dumpfm' => 'ApiFormatDump',
                'none' => 'ApiFormatNone',
        );
 
index 6d1b1ec..8a1eb96 100644 (file)
        "apihelp-format-example-generic": "Format the query result in the $1 format.",
        "apihelp-dbg-description": "Output data in PHP's <code>var_export()</code> format.",
        "apihelp-dbgfm-description": "Output data in PHP's <code>var_export()</code> format (pretty-print in HTML).",
-       "apihelp-dump-description": "Output data in PHP's <code>var_dump()</code> format.",
-       "apihelp-dumpfm-description": "Output data in PHP's <code>var_dump()</code> format (pretty-print in HTML).",
        "apihelp-json-description": "Output data in JSON format.",
        "apihelp-json-param-callback": "If specified, wraps the output into a given function call. For safety, all user-specific data will be restricted.",
        "apihelp-json-param-utf8": "If specified, encodes most (but not all) non-ASCII characters as UTF-8 instead of replacing them with hexadecimal escape sequences. Default when <var>formatversion</var> is not <kbd>1</kbd>.",
        "apihelp-rawfm-description": "Output data with the debugging elements in JSON format (pretty-print in HTML).",
        "apihelp-txt-description": "Output data in PHP's <code>print_r()</code> format.",
        "apihelp-txtfm-description": "Output data in PHP's <code>print_r()</code> format (pretty-print in HTML).",
-       "apihelp-wddx-description": "Output data in WDDX format.",
-       "apihelp-wddxfm-description": "Output data in WDDX format (pretty-print in HTML).",
        "apihelp-xml-description": "Output data in XML format.",
        "apihelp-xml-param-xslt": "If specified, adds the named page as an XSL stylesheet. The value must be a title in the {{ns:mediawiki}} namespace ending in <code>.xsl</code>.",
        "apihelp-xml-param-includexmlnamespace": "If specified, adds an XML namespace.",
index c436d4f..7a0f702 100644 (file)
        "apihelp-format-example-generic": "{{doc-apihelp-example|format|params=* $1 - Format name|paramstart=2|noseealso=1}}",
        "apihelp-dbg-description": "{{doc-apihelp-description|dbg|seealso=* {{msg-mw|apihelp-dbgfm-description}}}}",
        "apihelp-dbgfm-description": "{{doc-apihelp-description|dbgfm|seealso=* {{msg-mw|apihelp-dbg-description}}}}",
-       "apihelp-dump-description": "{{doc-apihelp-description|dump|seealso=* {{msg-mw|apihelp-dumpfm-description}}}}",
-       "apihelp-dumpfm-description": "{{doc-apihelp-description|dumpfm|seealso=* {{msg-mw|apihelp-dump-description}}}}",
        "apihelp-json-description": "{{doc-apihelp-description|json|seealso=* {{msg-mw|apihelp-jsonfm-description}}}}",
        "apihelp-json-param-callback": "{{doc-apihelp-param|json|callback}}",
        "apihelp-json-param-utf8": "{{doc-apihelp-param|json|utf8}}",
        "apihelp-rawfm-description": "{{doc-apihelp-description|rawfm|seealso=* {{msg-mw|apihelp-raw-description}}}}",
        "apihelp-txt-description": "{{doc-apihelp-description|txt|seealso=* {{msg-mw|apihelp-txtfm-description}}}}",
        "apihelp-txtfm-description": "{{doc-apihelp-description|txtfm|seealso=* {{msg-mw|apihelp-txt-description}}}}",
-       "apihelp-wddx-description": "{{doc-apihelp-description|wddx|seealso=* {{msg-mw|apihelp-wddxfm-description}}}}",
-       "apihelp-wddxfm-description": "{{doc-apihelp-description|wddxfm|seealso=* {{msg-mw|apihelp-wddx-description}}}}",
        "apihelp-xml-description": "{{doc-apihelp-description|xml|seealso=* {{msg-mw|apihelp-xmlfm-description}}}}",
        "apihelp-xml-param-xslt": "{{doc-apihelp-param|xml|xslt}}",
        "apihelp-xml-param-includexmlnamespace": "{{doc-apihelp-param|xml|includexmlnamespace}}",
diff --git a/tests/phpunit/includes/api/format/ApiFormatDumpTest.php b/tests/phpunit/includes/api/format/ApiFormatDumpTest.php
deleted file mode 100644 (file)
index c0f67f8..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/**
- * @group API
- * @covers ApiFormatDump
- */
-class ApiFormatDumpTest extends ApiFormatTestBase {
-
-       protected $printerName = 'dump';
-
-       public static function provideGeneralEncoding() {
-               // Sigh. Docs claim it's a boolean, but can have values 0, 1, or 2.
-               // Fortunately wfIniGetBool does the right thing.
-               if ( wfIniGetBool( 'xdebug.overload_var_dump' ) ) {
-                       return array(
-                               array( array(), 'Cannot test ApiFormatDump when xDebug overloads var_dump', array( 'SKIP' => true ) ),
-                       );
-               }
-
-               $warning = "\n  [\"warnings\"]=>\n  array(1) {\n    [\"dump\"]=>\n    array(1) {\n      [\"*\"]=>\n" .
-                       "      string(64) \"format=dump has been deprecated. Please use format=json instead.\"\n" .
-                       "    }\n  }";
-
-               return array(
-                       // Basic types
-                       array( array( null ), "array(2) {{$warning}\n  [0]=>\n  NULL\n}\n" ),
-                       array( array( true ), "array(2) {{$warning}\n  [0]=>\n  string(0) \"\"\n}\n" ),
-                       array( array( false ), "array(1) {{$warning}\n}\n" ),
-                       array( array( true, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "array(2) {{$warning}\n  [0]=>\n  bool(true)\n}\n" ),
-                       array( array( false, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "array(2) {{$warning}\n  [0]=>\n  bool(false)\n}\n" ),
-                       array( array( 42 ), "array(2) {{$warning}\n  [0]=>\n  int(42)\n}\n" ),
-                       array( array( 42.5 ), "array(2) {{$warning}\n  [0]=>\n  float(42.5)\n}\n" ),
-                       array( array( 1e42 ), "array(2) {{$warning}\n  [0]=>\n  float(1.0E+42)\n}\n" ),
-                       array( array( 'foo' ), "array(2) {{$warning}\n  [0]=>\n  string(3) \"foo\"\n}\n" ),
-                       array( array( 'fóo' ), "array(2) {{$warning}\n  [0]=>\n  string(4) \"fóo\"\n}\n" ),
-
-                       // Arrays
-                       array( array( array() ), "array(2) {{$warning}\n  [0]=>\n  array(0) {\n  }\n}\n" ),
-                       array( array( array( 1 ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1 ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [\"x\"]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 2 => 1 ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [2]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( (object)array() ), "array(2) {{$warning}\n  [0]=>\n  array(0) {\n  }\n}\n" ),
-                       array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [\"x\"]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                               "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [0]=>\n    array(2) {\n      [\"key\"]=>\n      string(1) \"x\"\n      [\"*\"]=>\n      int(1)\n    }\n  }\n}\n" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "array(2) {{$warning}\n  [0]=>\n  array(1) {\n    [\"x\"]=>\n    int(1)\n  }\n}\n" ),
-                       array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "array(2) {{$warning}\n  [0]=>\n  array(2) {\n    [0]=>\n    string(1) \"a\"\n    [1]=>\n    string(1) \"b\"\n  }\n}\n" ),
-
-                       // Content
-                       array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ),
-                               "array(2) {{$warning}\n  [\"*\"]=>\n  string(3) \"foo\"\n}\n" ),
-
-                       // BC Subelements
-                       array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ),
-                               "array(2) {{$warning}\n  [\"foo\"]=>\n  array(1) {\n    [\"*\"]=>\n    string(3) \"foo\"\n  }\n}\n" ),
-               );
-       }
-
-}
diff --git a/tests/phpunit/includes/api/format/ApiFormatWddxTest.php b/tests/phpunit/includes/api/format/ApiFormatWddxTest.php
deleted file mode 100644 (file)
index 0711130..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-/**
- * @group API
- * @covers ApiFormatWddx
- */
-class ApiFormatWddxTest extends ApiFormatTestBase {
-
-       protected $printerName = 'wddx';
-
-       public static function provideGeneralEncoding() {
-               if ( ApiFormatWddx::useSlowPrinter() ) {
-                       return array(
-                               array( array(), 'Fast Wddx printer is unavailable', array( 'SKIP' => true ) )
-                       );
-               }
-               return self::provideEncoding();
-       }
-
-       public static function provideEncoding() {
-               $p = '<wddxPacket version=\'1.0\'><header/><data><struct><var name=\'warnings\'><struct><var name=\'wddx\'><struct><var name=\'*\'><string>format=wddx has been deprecated. Please use format=json instead.</string></var></struct></var></struct></var>';
-               $s = '</struct></data></wddxPacket>';
-
-               return array(
-                       // Basic types
-                       array( array( null ), "{$p}<var name='0'><null/></var>{$s}" ),
-                       array( array( true ), "{$p}<var name='0'><string></string></var>{$s}" ),
-                       array( array( false ), "{$p}{$s}" ),
-                       array( array( true, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "{$p}<var name='0'><boolean value='true'/></var>{$s}" ),
-                       array( array( false, ApiResult::META_BC_BOOLS => array( 0 ) ),
-                               "{$p}<var name='0'><boolean value='false'/></var>{$s}" ),
-                       array( array( 42 ), "{$p}<var name='0'><number>42</number></var>{$s}" ),
-                       array( array( 42.5 ), "{$p}<var name='0'><number>42.5</number></var>{$s}" ),
-                       array( array( 1e42 ), "{$p}<var name='0'><number>1.0E+42</number></var>{$s}" ),
-                       array( array( 'foo' ), "{$p}<var name='0'><string>foo</string></var>{$s}" ),
-                       array( array( 'fóo' ), "{$p}<var name='0'><string>fóo</string></var>{$s}" ),
-
-                       // Arrays and objects
-                       array( array( array() ), "{$p}<var name='0'><array length='0'></array></var>{$s}" ),
-                       array( array( array( 1 ) ), "{$p}<var name='0'><array length='1'><number>1</number></array></var>{$s}" ),
-                       array( array( array( 'x' => 1 ) ), "{$p}<var name='0'><struct><var name='x'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 2 => 1 ) ), "{$p}<var name='0'><struct><var name='2'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( (object)array() ), "{$p}<var name='0'><struct></struct></var>{$s}" ),
-                       array( array( array( 1, ApiResult::META_TYPE => 'assoc' ) ), "{$p}<var name='0'><struct><var name='0'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'array' ) ), "{$p}<var name='0'><array length='1'><number>1</number></array></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'kvp' ) ), "{$p}<var name='0'><struct><var name='x'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCkvp', ApiResult::META_KVP_KEY_NAME => 'key' ) ),
-                               "{$p}<var name='0'><array length='1'><struct><var name='key'><string>x</string></var><var name='*'><number>1</number></var></struct></array></var>{$s}" ),
-                       array( array( array( 'x' => 1, ApiResult::META_TYPE => 'BCarray' ) ), "{$p}<var name='0'><struct><var name='x'><number>1</number></var></struct></var>{$s}" ),
-                       array( array( array( 'a', 'b', ApiResult::META_TYPE => 'BCassoc' ) ), "{$p}<var name='0'><array length='2'><string>a</string><string>b</string></array></var>{$s}" ),
-
-                       // Content
-                       array( array( 'content' => 'foo', ApiResult::META_CONTENT => 'content' ),
-                               "{$p}<var name='*'><string>foo</string></var>{$s}" ),
-
-                       // BC Subelements
-                       array( array( 'foo' => 'foo', ApiResult::META_BC_SUBELEMENTS => array( 'foo' ) ),
-                               "{$p}<var name='foo'><struct><var name='*'><string>foo</string></var></struct></var>{$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 = '<?xml version="1.0"?>' . $expect;
-
-               $this->assertSame( $expect, $this->encodeData( $params, $data, 'ApiFormatWddxTest_SlowWddx' ) );
-       }
-}
-
-class ApiFormatWddxTest_SlowWddx extends ApiFormatWddx {
-       public static function useSlowPrinter() {
-               return true;
-       }
-}