From a11cf96d0688f07761fb4ae75a4958f76465f0da Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 2 Aug 2011 04:04:03 +0000 Subject: [PATCH] * 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 --- tests/phpunit/includes/api/ApiTest.php | 30 +++++++++++---------- tests/phpunit/includes/api/ApiWatchTest.php | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/includes/api/ApiTest.php b/tests/phpunit/includes/api/ApiTest.php index a587e6b19f..139f8465f5 100644 --- a/tests/phpunit/includes/api/ApiTest.php +++ b/tests/phpunit/includes/api/ApiTest.php @@ -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() { diff --git a/tests/phpunit/includes/api/ApiWatchTest.php b/tests/phpunit/includes/api/ApiWatchTest.php index 3c7ff3040e..0fa8053399 100644 --- a/tests/phpunit/includes/api/ApiWatchTest.php +++ b/tests/phpunit/includes/api/ApiWatchTest.php @@ -41,6 +41,7 @@ class ApiWatchTest extends ApiTestCase { /** * @depends testWatchEdit + * @group Broken */ function testWatchClear() { -- 2.20.1