* @param $key String Name of the key to validate in the serialized JSON
* @dataProvider provideJsonSerializedKeys
*/
- function testJsonserializeexceptionKeys($expectedKeyType, $exClass, $key) {
+ function testJsonserializeexceptionKeys( $expectedKeyType, $exClass, $key ) {
# Make sure we log a backtrace:
$this->setMwGlobals( array( 'wgLogExceptionBacktrace' => true ) );
"JSON serialized exception is missing key '$key'"
);
$this->assertInternalType( $expectedKeyType, $json->$key,
- "JSON serialized key '$key' has type " . gettype($json->$key)
+ "JSON serialized key '$key' has type " . gettype( $json->$key )
. " (expected: $expectedKeyType)."
);
}
*/
function provideJsonSerializedKeys() {
$testCases = array();
- foreach( array( 'Exception', 'MWException' ) as $exClass ) {
+ foreach ( array( 'Exception', 'MWException' ) as $exClass ) {
$exTests = array(
array( 'string', $exClass, 'id' ),
array( 'string', $exClass, 'file' ),
# Backtrace only enabled with wgLogExceptionBacktrace = true
array( 'array', $exClass, 'backtrace' ),
);
- $testCases = array_merge($testCases, $exTests);
+ $testCases = array_merge( $testCases, $exTests );
}
return $testCases;
}