Skip to content

Commit 70cece1

Browse files
committed
Run tests against Wikimedia beta
1 parent be04ff5 commit 70cece1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/MediawikiApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static function newFromPage( $url ) {
8181
$pageXml = new SimpleXMLElement( $tempClient->get( $url )->getBody() );
8282
$rsdElement = $pageXml->xpath( 'head/link[@type="application/rsd+xml"][@href]' );
8383
$rsdXml = new SimpleXMLElement( $tempClient->get( $rsdElement[0]->attributes()['href'] )->getBody() );
84-
self::newFromApiEndpoint( $rsdXml->service->apis->api->attributes()->apiLink->__toString() );
84+
return self::newFromApiEndpoint( $rsdXml->service->apis->api->attributes()->apiLink->__toString() );
8585
}
8686

8787
/**

tests/integration/MediawikiApiTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@
1111
class MediawikiApiTest extends \PHPUnit_Framework_TestCase {
1212

1313
public function testNewFromPage() {
14-
$api = MediawikiApi::newFromPage( 'http://localhost/w' );
14+
$api = MediawikiApi::newFromPage( 'http://deployment.wikimedia.beta.wmflabs.org/wiki/Main_Page' );
1515
$this->assertInstanceOf( 'Mediawiki\Api\MediawikiApi', $api );
1616
}
1717

1818
public function testQueryGetResponse() {
19-
$api = new MediawikiApi( 'http://localhost/w/api.php' );
19+
$api = MediawikiApi::newFromApiEndpoint( 'http://deployment.wikimedia.beta.wmflabs.org/w/api.php' );
2020
$response = $api->getRequest( new SimpleRequest( 'query' ) );
2121
$this->assertEquals( array( 'batchcomplete' => '' ), $response );
2222
}
2323

2424
public function testQueryGetResponseAsync() {
25-
$api = new MediawikiApi( 'http://localhost/w/api.php' );
25+
$api = MediawikiApi::newFromApiEndpoint( 'http://deployment.wikimedia.beta.wmflabs.org/w/api.php' );
2626
$response = $api->getRequestAsync( new SimpleRequest( 'query' ) );
2727
$this->assertEquals( array( 'batchcomplete' => '' ), $response->wait() );
2828
}
2929

3030
public function testQueryPostResponse() {
31-
$api = new MediawikiApi( 'http://localhost/w/api.php' );
31+
$api = MediawikiApi::newFromApiEndpoint( 'http://deployment.wikimedia.beta.wmflabs.org/w/api.php' );
3232
$response = $api->postRequest( new SimpleRequest( 'query' ) );
3333
$this->assertEquals( array( 'batchcomplete' => '' ), $response );
3434
}
3535

3636
public function testQueryPostResponseAsync() {
37-
$api = new MediawikiApi( 'http://localhost/w/api.php' );
37+
$api = MediawikiApi::newFromApiEndpoint( 'http://deployment.wikimedia.beta.wmflabs.org/w/api.php' );
3838
$response = $api->postRequestAsync( new SimpleRequest( 'query' ) );
3939
$this->assertEquals( array( 'batchcomplete' => '' ), $response->wait() );
4040
}

tests/integration/TokenHandlingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TokenHandlingTest extends \PHPUnit_Framework_TestCase {
1313
* @dataProvider provideTokenTypes
1414
*/
1515
public function testGetAnonUserToken() {
16-
$api = new MediawikiApi( 'http://localhost/w/api.php' );
16+
$api = MediawikiApi::newFromApiEndpoint( 'http://deployment.wikimedia.beta.wmflabs.org/w/api.php' );
1717
$this->assertEquals( '+\\', $api->getToken() );
1818
}
1919

0 commit comments

Comments
 (0)