* ApiTest: mark testApiGotCookie() broken, since it is
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 2 Aug 2011 04:04:03 +0000 (04:04 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 2 Aug 2011 04:04:03 +0000 (04:04 +0000)
* ApiTest: partially cleanup testApiListPages() to make it not depend on broken testApiGotCookie(). Not sure what we're testing here, so still marking incomplete.
* ApiWatchTest: mark testWatchClear() as broken rather than skipped due to failing testWatchEdit(). This class needs some love <3

tests/phpunit/includes/api/ApiTest.php
tests/phpunit/includes/api/ApiWatchTest.php

index a587e6b..139f846 100644 (file)
@@ -148,6 +148,9 @@ class ApiTest extends ApiTestCase {
                $this->assertEquals( "Success", $a );
        }
 
+       /**
+        * @group Broken
+        */
        function testApiGotCookie() {
                $this->markTestIncomplete( "The server can't do external HTTP requests, and the internal one won't give cookies"  );
 
@@ -192,24 +195,23 @@ class ApiTest extends ApiTestCase {
        }
 
        /**
-        * @depends testApiGotCookie
+        * @todo Finish filling me out...what are we trying to test here?
         */
-       function testApiListPages( CookieJar $cj ) {
-               $this->markTestIncomplete( "Not done with this yet" );
+       function testApiListPages() {
                global $wgServer;
-
-               if ( $wgServer == "http://localhost" ) {
+               if ( !isset( $wgServer ) ) {
                        $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' );
                }
-               $req = MWHttpRequest::factory( self::$apiUrl . "?action=query&format=xml&prop=revisions&" .
-                                                                        "titles=Main%20Page&rvprop=timestamp|user|comment|content" );
-               $req->setCookieJar( $cj );
-               $req->execute();
-               libxml_use_internal_errors( true );
-               $sxe = simplexml_load_string( $req->getContent() );
-               $this->assertNotInternalType( "bool", $sxe );
-               $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) );
-               $a = $sxe->query[0]->pages[0]->page[0]->attributes();
+
+               $ret = $this->doApiRequest( array(
+                       'action' => 'query',
+                       'prop'   => 'revisions',
+                       'titles' => 'Main Page',
+                       'rvprop' => 'timestamp|user|comment|content',
+               ) );
+
+               $result = $ret[0]['query']['pages'];
+               $this->markTestIncomplete( "Somebody needs to finish loving me" );
        }
        
        function testRunLogin() {
index 3c7ff30..0fa8053 100644 (file)
@@ -41,6 +41,7 @@ class ApiWatchTest extends ApiTestCase {
 
        /**
         * @depends testWatchEdit
+        * @group Broken
         */
        function testWatchClear() {