X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fhtmlform%2FHTMLAutoCompleteSelectFieldTest.php;h=fbabf7ffad674fcd4a1d9f5de07f8824a35d57b3;hb=f5a31f5be0c23bb14a754032803aa226ce761411;hp=2c7f50c9c4c8ae2d338c57a5643ed3d5d64faa98;hpb=664e96256623df3928463dcbcceaf8b54388ad62;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php b/tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php index 2c7f50c9c4..eaba22d7fb 100644 --- a/tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php +++ b/tests/phpunit/includes/htmlform/HTMLAutoCompleteSelectFieldTest.php @@ -1,16 +1,14 @@ 'BGR', 'Burkina Faso' => 'BFA', 'Burundi' => 'BDI', - ); + ]; /** * Verify that attempting to instantiate an HTMLAutoCompleteSelectField @@ -21,7 +19,7 @@ class HtmlAutoCompleteSelectFieldTest extends MediaWikiTestCase { * @expectedExceptionMessage called without any autocompletions */ function testMissingAutocompletions() { - new HTMLAutoCompleteSelectField( array( 'fieldname' => 'Test' ) ); + new HTMLAutoCompleteSelectField( [ 'fieldname' => 'Test' ] ); } /** @@ -31,12 +29,12 @@ class HtmlAutoCompleteSelectFieldTest extends MediaWikiTestCase { * @covers HTMLAutoCompleteSelectField::getAttributes */ function testGetAttributes() { - $field = new HTMLAutoCompleteSelectField( array( + $field = new HTMLAutoCompleteSelectField( [ 'fieldname' => 'Test', 'autocomplete' => $this->options, - ) ); + ] ); - $attributes = $field->getAttributes( array() ); + $attributes = $field->getAttributes( [] ); $this->assertEquals( array_keys( $this->options ), FormatJson::decode( $attributes['data-autocomplete'] ), "The 'data-autocomplete' attribute encodes autocomplete option keys as a JSON array." @@ -48,11 +46,11 @@ class HtmlAutoCompleteSelectFieldTest extends MediaWikiTestCase { * the presence or absence of the 'options' parameter. */ function testOptionalSelectElement() { - $params = array( - 'fieldname' => 'Test', - 'autocomplete' => $this->options, - 'options' => $this->options, - ); + $params = [ + 'fieldname' => 'Test', + 'autocomplete-data' => $this->options, + 'options' => $this->options, + ]; $field = new HTMLAutoCompleteSelectField( $params ); $html = $field->getInputHTML( false );