I7b37295e is going to be changing around how ApiResult works, which is going to need corresponding changes in the formatters. So it would probably be a good idea to have a decent starting point to catch any breakage. The non-backwards-compatible changes to ApiFormatTestBase shouldn't be a concern, as no extensions in Gerrit reference this class or any /ApiFormat.*Test/ class. This also fixes two small bugs in ApiFormatWddx (null handling and spacing for non-fm slow path) discovered during testing, and works around some HHVM wddx extension bugs. Bug: T85236 Change-Id: I9cdf896e7070ed51e42625d61609ad9ef91cd567
34 lines
725 B
PHP
34 lines
725 B
PHP
<?php
|
|
|
|
/**
|
|
* @group API
|
|
* @covers ApiFormatNone
|
|
*/
|
|
class ApiFormatNoneTest extends ApiFormatTestBase {
|
|
|
|
protected $printerName = 'none';
|
|
|
|
public static function provideGeneralEncoding() {
|
|
return array(
|
|
// Basic types
|
|
array( array( null ), '' ),
|
|
array( array( true ), '' ),
|
|
array( array( false ), '' ),
|
|
array( array( 42 ), '' ),
|
|
array( array( 42.5 ), '' ),
|
|
array( array( 1e42 ), '' ),
|
|
array( array( 'foo' ), '' ),
|
|
array( array( 'fóo' ), '' ),
|
|
|
|
// Arrays and objects
|
|
array( array( array() ), '' ),
|
|
array( array( array( 1 ) ), '' ),
|
|
array( array( array( 'x' => 1 ) ), '' ),
|
|
array( array( array( 2 => 1 ) ), '' ),
|
|
|
|
// Content
|
|
array( array( '*' => 'foo' ), '' ),
|
|
);
|
|
}
|
|
|
|
}
|