mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-23 23:13:27 +00:00
Use …->assertArrayHasKey() instead of isset()
… as well as update a line of documentation I had stashed. I think this does not need it's own patch, or does it? Change-Id: I99eee1f7b5ec96c1c75e73d66200bc41807452fa
This commit is contained in:
parent
722141ff0c
commit
6b22f1089e
|
@ -135,7 +135,7 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo {
|
|||
* Generates a structured list of Gadget objects from a definition
|
||||
*
|
||||
* @param string $definition
|
||||
* @return array Array( name => Gadget )
|
||||
* @return Gadget[] List of Gadget objects indexed by the gadget's name.
|
||||
*/
|
||||
private function listFromDefinition( $definition ) {
|
||||
$definition = preg_replace( '/<!--.*?-->/s', '', $definition );
|
||||
|
|
|
@ -163,9 +163,10 @@ class GadgetsTest extends MediaWikiTestCase {
|
|||
$this->assertTrue( GadgetHooks::getPreferences( new User, $prefs ), 'GetPrefences hook should return true' );
|
||||
|
||||
$options = $prefs['gadgets']['options'];
|
||||
$this->assertFalse( isset( $options['⧼gadget-section-remove-section⧽'] ), 'Must not show empty sections' );
|
||||
$this->assertTrue( isset( $options['⧼gadget-section-keep-section1⧽'] ) );
|
||||
$this->assertTrue( isset( $options['⧼gadget-section-keep-section2⧽'] ) );
|
||||
$this->assertArrayNotHasKey( '⧼gadget-section-remove-section⧽', $options,
|
||||
'Must not show empty sections' );
|
||||
$this->assertArrayHasKey( '⧼gadget-section-keep-section1⧽', $options );
|
||||
$this->assertArrayHasKey( '⧼gadget-section-keep-section2⧽', $options );
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
|
|
Loading…
Reference in a new issue