Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/158332

Change subject: Remove the old GadgetsTest that is broken
......................................................................

Remove the old GadgetsTest that is broken

Change-Id: Iedf9e5fab9c460ff1234893bd1024bcd2f95f2fe
---
D tests/old/GadgetsTest.php
1 file changed, 0 insertions(+), 89 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gadgets 
refs/changes/32/158332/1

diff --git a/tests/old/GadgetsTest.php b/tests/old/GadgetsTest.php
deleted file mode 100644
index b479c6e..0000000
--- a/tests/old/GadgetsTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-/**
- * @group Gadgets
- */
-
-/**
- * @group Broken
- */
-class GadgetsTest extends PHPUnit_Framework_TestCase {
-       private function create( $line ) {
-               // TODO fails now
-               $g = Gadget::newFromDefinition( $line );
-               // assertInstanceOf() is available since PHPUnit 3.5
-               $this->assertEquals( 'Gadget', get_class( $g ) );
-
-               return $g;
-       }
-
-       function testInvalidLines() {
-               $this->assertFalse( Gadget::newFromDefinition( '' ) );
-               $this->assertFalse( Gadget::newFromDefinition( '<foo|bar>' ) );
-       }
-
-       function testSimpleCases() {
-               $g = $this->create( '* foo bar| foo.css|foo.js|foo.bar' ); 
//FIXME
-               $this->assertEquals( 'foo_bar', $g->getId() );
-               $this->assertEquals( 'ext.gadget.foo_bar', $g->getModuleName() 
);
-               $this->assertEquals( array( 'Gadget-foo.js' ), $g->getScripts() 
);
-               $this->assertEquals( array( 'Gadget-foo.css' ), $g->getStyles() 
);
-               $this->assertEquals( array( 'Gadget-foo.js', 'Gadget-foo.css' ),
-                       $g->getScriptsAndStyles() );
-               $this->assertEquals( array( 'Gadget-foo.js' ), 
$g->getLegacyScripts() );
-               $this->assertFalse( $g->supportsResourceLoader() );
-               $this->assertTrue( $g->hasModule() );
-       }
-
-       function testRLtag() {
-               $g = $this->create( '*foo [ResourceLoader]|foo.js|foo.css' ); 
//FIXME
-               $this->assertEquals( 'foo', $g->getId() );
-               $this->assertTrue( $g->supportsResourceLoader() );
-               $this->assertEquals( 0, count( $g->getLegacyScripts() ) );
-       }
-
-       function testDependencies() {
-               $g = $this->create( '* 
foo[ResourceLoader|dependencies=jquery.ui]|bar.js' ); //FIXME
-               $this->assertEquals( array( 'Gadget-bar.js' ), $g->getScripts() 
);
-               $this->assertTrue( $g->supportsResourceLoader() );
-               $this->assertEquals( array( 'jquery.ui' ), 
$g->getDependencies() );
-       }
-
-       function testPreferences() {
-               // FIXME this test is broken
-               $this->markTestIncomplete( 'Broken for now' );
-               return;
-
-               global $wgUser, $wgOut, $wgTitle;
-
-               // This test makes call to the parser which requires valid 
OutputPage
-               // and Title objects. Set them up here, they will be released 
at the
-               // end of the test.
-               $old_wgOut = $wgOut;
-               $old_wgTitle = $wgTitle;
-               $wgTitle = Title::newFromText( 'Parser test for Gadgets 
extension' );
-
-               // Proceed with test setup:
-               $prefs = array();
-               $context = new RequestContext();
-               $wgOut = $context->getOutput();
-               $wgOut->setTitle( Title::newFromText( 'test' ) );
-
-               Gadget::loadStructuredList( '* foo | foo.js
-==keep-section1==
-* bar| bar.js
-==remove-section==
-* baz [rights=embezzle] |baz.js
-==keep-section2==
-* quux [rights=read] | quux.js' );
-               $this->assertTrue( GadgetsHooks::getPreferences( $wgUser, 
$prefs ), 'GetPrefences hook should return true' );
-
-               $options = $prefs['gadgets']['options'];
-               $this->assertFalse( isset( 
$options['&lt;gadget-section-remove-section&gt;'] ), 'Must not show empty 
sections' );
-               $this->assertTrue( isset( 
$options['&lt;gadget-section-keep-section1&gt;'] ) );
-               $this->assertTrue( isset( 
$options['&lt;gadget-section-keep-section2&gt;'] ) );
-
-               // Restore globals
-               $wgOut = $old_wgOut;
-               $wgTitle = $old_wgTitle;
-       }
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/158332
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedf9e5fab9c460ff1234893bd1024bcd2f95f2fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gadgets
Gerrit-Branch: RL2
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to