wddx_serialize_value() fails to escape the ampersand under HHVM. It has been fixed upstream https://github.com/facebook/hhvm/issues/4283 but has not been released yet. When running under HHVM and detecting the ampersand is not escaped, skip the test.. Bug: T75531 Change-Id: Ia58ec20b4daf78cd90da1bdf8af6cac86015c5d7
28 lines
826 B
PHP
28 lines
826 B
PHP
<?php
|
|
|
|
/**
|
|
* @group API
|
|
* @group Database
|
|
* @group medium
|
|
* @covers ApiFormatWddx
|
|
*/
|
|
class ApiFormatWddxTest extends ApiFormatTestBase {
|
|
|
|
public function testValidSyntax( ) {
|
|
if ( !function_exists( 'wddx_deserialize' ) ) {
|
|
$this->markTestSkipped( "Function 'wddx_deserialize' not exist, skipping." );
|
|
}
|
|
|
|
if ( wfIsHHVM() && false === strpos( wddx_serialize_value( "Test for &" ), '&' ) ) {
|
|
# Some version of HHVM fails to escape the ampersand
|
|
#
|
|
# https://phabricator.wikimedia.org/T75531
|
|
$this->markTestSkipped( "wddx_deserialize is bugged under this version of HHVM" );
|
|
}
|
|
|
|
$data = $this->apiRequest( 'wddx', array( 'action' => 'query', 'meta' => 'siteinfo' ) );
|
|
|
|
$this->assertInternalType( 'array', wddx_deserialize( $data ) );
|
|
$this->assertGreaterThan( 0, count( (array)$data ) );
|
|
}
|
|
}
|