|
11 | 11 | class MediawikiApiTest extends \PHPUnit_Framework_TestCase {
|
12 | 12 |
|
13 | 13 | public function testNewFromPage() {
|
14 |
| - $api = MediawikiApi::newFromPage( 'http://localhost/w' ); |
| 14 | + $api = MediawikiApi::newFromPage( 'http://deployment.wikimedia.beta.wmflabs.org/wiki/Main_Page' ); |
15 | 15 | $this->assertInstanceOf( 'Mediawiki\Api\MediawikiApi', $api );
|
16 | 16 | }
|
17 | 17 |
|
18 | 18 | 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' ); |
20 | 20 | $response = $api->getRequest( new SimpleRequest( 'query' ) );
|
21 | 21 | $this->assertEquals( array( 'batchcomplete' => '' ), $response );
|
22 | 22 | }
|
23 | 23 |
|
24 | 24 | 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' ); |
26 | 26 | $response = $api->getRequestAsync( new SimpleRequest( 'query' ) );
|
27 | 27 | $this->assertEquals( array( 'batchcomplete' => '' ), $response->wait() );
|
28 | 28 | }
|
29 | 29 |
|
30 | 30 | 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' ); |
32 | 32 | $response = $api->postRequest( new SimpleRequest( 'query' ) );
|
33 | 33 | $this->assertEquals( array( 'batchcomplete' => '' ), $response );
|
34 | 34 | }
|
35 | 35 |
|
36 | 36 | 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' ); |
38 | 38 | $response = $api->postRequestAsync( new SimpleRequest( 'query' ) );
|
39 | 39 | $this->assertEquals( array( 'batchcomplete' => '' ), $response->wait() );
|
40 | 40 | }
|
|
0 commit comments