From da8ba7c544d815715956c464ba55ead7857377eb Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 2 Apr 2012 15:33:43 +0200 Subject: [PATCH] Regroup all API tests in the 'API' PHPUnit group That will let us tests all the API tests by using PHPUnit group filtering such as: php phpunit.php --group API Also cleaned some whitespaces Patchset-4: skipped files that had only whitespace changes Change-Id: I51e03d910521b061f505e3a9b11a08c7b95f1538 --- tests/phpunit/includes/api/ApiBlockTest.php | 1 + tests/phpunit/includes/api/ApiPurgeTest.php | 1 + tests/phpunit/includes/api/ApiQueryTest.php | 1 + tests/phpunit/includes/api/ApiTest.php | 1 + tests/phpunit/includes/api/ApiUploadTest.php | 1 + tests/phpunit/includes/api/ApiWatchTest.php | 25 ++++++++++---------- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php index 514da42120..d9ea7b5a87 100644 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ b/tests/phpunit/includes/api/ApiBlockTest.php @@ -1,6 +1,7 @@ doLogin(); } - + function getTokens() { return $this->getTokenList( self::$users['sysop'] ); } @@ -19,9 +20,9 @@ class ApiWatchTest extends ApiTestCase { * @group Broken */ function testWatchEdit() { - + $data = $this->getTokens(); - + $keys = array_keys( $data[0]['query']['pages'] ); $key = array_pop( $keys ); $pageinfo = $data[0]['query']['pages'][$key]; @@ -44,7 +45,7 @@ class ApiWatchTest extends ApiTestCase { * @group Broken */ function testWatchClear() { - + $data = $this->doApiRequest( array( 'action' => 'query', 'list' => 'watchlist' ), $data ); @@ -71,11 +72,11 @@ class ApiWatchTest extends ApiTestCase { /** * @group Broken - */ + */ function testWatchProtect() { - + $data = $this->getTokens(); - + $keys = array_keys( $data[0]['query']['pages'] ); $key = array_pop( $keys ); $pageinfo = $data[0]['query']['pages'][$key]; @@ -97,9 +98,9 @@ class ApiWatchTest extends ApiTestCase { * @group Broken */ function testGetRollbackToken() { - + $data = $this->getTokens(); - + if ( !Title::newFromText( 'UTPage' )->exists() ) { $this->markTestIncomplete( "The article [[UTPage]] does not exist" ); } @@ -159,9 +160,9 @@ class ApiWatchTest extends ApiTestCase { * @group Broken */ function testWatchDelete() { - + $data = $this->getTokens(); - + $keys = array_keys( $data[0]['query']['pages'] ); $key = array_pop( $keys ); $pageinfo = $data[0]['query']['pages'][$key]; -- 2.20.1