r93703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93702‎ | r93703 | r93704 >
Date:04:04, 2 August 2011
Author:demon
Status:ok
Tags:
Comment:
* ApiTest: mark testApiGotCookie() broken, since it is
* 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
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/api/ApiTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/api/ApiWatchTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/api/ApiTest.php
@@ -148,6 +148,9 @@
149149 $this->assertEquals( "Success", $a );
150150 }
151151
 152+ /**
 153+ * @group Broken
 154+ */
152155 function testApiGotCookie() {
153156 $this->markTestIncomplete( "The server can't do external HTTP requests, and the internal one won't give cookies" );
154157
@@ -192,24 +195,23 @@
193196 }
194197
195198 /**
196 - * @depends testApiGotCookie
 199+ * @todo Finish filling me out...what are we trying to test here?
197200 */
198 - function testApiListPages( CookieJar $cj ) {
199 - $this->markTestIncomplete( "Not done with this yet" );
 201+ function testApiListPages() {
200202 global $wgServer;
201 -
202 - if ( $wgServer == "http://localhost" ) {
 203+ if ( !isset( $wgServer ) ) {
203204 $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' );
204205 }
205 - $req = MWHttpRequest::factory( self::$apiUrl . "?action=query&format=xml&prop=revisions&" .
206 - "titles=Main%20Page&rvprop=timestamp|user|comment|content" );
207 - $req->setCookieJar( $cj );
208 - $req->execute();
209 - libxml_use_internal_errors( true );
210 - $sxe = simplexml_load_string( $req->getContent() );
211 - $this->assertNotInternalType( "bool", $sxe );
212 - $this->assertThat( $sxe, $this->isInstanceOf( "SimpleXMLElement" ) );
213 - $a = $sxe->query[0]->pages[0]->page[0]->attributes();
 206+
 207+ $ret = $this->doApiRequest( array(
 208+ 'action' => 'query',
 209+ 'prop' => 'revisions',
 210+ 'titles' => 'Main Page',
 211+ 'rvprop' => 'timestamp|user|comment|content',
 212+ ) );
 213+
 214+ $result = $ret[0]['query']['pages'];
 215+ $this->markTestIncomplete( "Somebody needs to finish loving me" );
214216 }
215217
216218 function testRunLogin() {
Index: trunk/phase3/tests/phpunit/includes/api/ApiWatchTest.php
@@ -41,6 +41,7 @@
4242
4343 /**
4444 * @depends testWatchEdit
 45+ * @group Broken
4546 */
4647 function testWatchClear() {
4748

Status & tagging log