X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2Fobjectcache%2FRESTBagOStuffTest.php;h=dfbca706d6fedde3caa47aa67ac6108e90738a7d;hb=d029197c7c5b083edef20fa79cc3e6d58e161f72;hp=66754fc93f05b89ba5395bf4fb0b6089c8f63b34;hpb=16ef3e79c4c52aa6b74563b7eadcfc9792e7a4c4;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/objectcache/RESTBagOStuffTest.php b/tests/phpunit/includes/objectcache/RESTBagOStuffTest.php index 66754fc93f..dfbca706d6 100644 --- a/tests/phpunit/includes/objectcache/RESTBagOStuffTest.php +++ b/tests/phpunit/includes/objectcache/RESTBagOStuffTest.php @@ -28,9 +28,10 @@ class RESTBagOStuffTest extends MediaWikiTestCase { public function testGet() { $this->client->expects( $this->once() )->method( 'run' )->with( [ 'method' => 'GET', - 'url' => 'http://test/rest/42xyz42' + 'url' => 'http://test/rest/42xyz42', + 'headers' => [] // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) - ] )->willReturn( [ 200, 'OK', [], 's:8:"somedata";', 0 ] ); + ] )->willReturn( [ 200, 'OK', [], '"somedata"', 0 ] ); $result = $this->bag->get( '42xyz42' ); $this->assertEquals( 'somedata', $result ); } @@ -38,7 +39,8 @@ class RESTBagOStuffTest extends MediaWikiTestCase { public function testGetNotExist() { $this->client->expects( $this->once() )->method( 'run' )->with( [ 'method' => 'GET', - 'url' => 'http://test/rest/42xyz42' + 'url' => 'http://test/rest/42xyz42', + 'headers' => [] // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) ] )->willReturn( [ 404, 'Not found', [], 'Nothing to see here', 0 ] ); $result = $this->bag->get( '42xyz42' ); @@ -48,7 +50,8 @@ class RESTBagOStuffTest extends MediaWikiTestCase { public function testGetBadClient() { $this->client->expects( $this->once() )->method( 'run' )->with( [ 'method' => 'GET', - 'url' => 'http://test/rest/42xyz42' + 'url' => 'http://test/rest/42xyz42', + 'headers' => [] // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) ] )->willReturn( [ 0, '', [], '', 'cURL has failed you today' ] ); $result = $this->bag->get( '42xyz42' ); @@ -59,7 +62,8 @@ class RESTBagOStuffTest extends MediaWikiTestCase { public function testGetBadServer() { $this->client->expects( $this->once() )->method( 'run' )->with( [ 'method' => 'GET', - 'url' => 'http://test/rest/42xyz42' + 'url' => 'http://test/rest/42xyz42', + 'headers' => [] // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) ] )->willReturn( [ 500, 'Too busy', [], 'Server is too busy', '' ] ); $result = $this->bag->get( '42xyz42' ); @@ -71,7 +75,8 @@ class RESTBagOStuffTest extends MediaWikiTestCase { $this->client->expects( $this->once() )->method( 'run' )->with( [ 'method' => 'PUT', 'url' => 'http://test/rest/42xyz42', - 'body' => 's:8:"postdata";' + 'body' => '"postdata"', + 'headers' => [] // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) ] )->willReturn( [ 200, 'OK', [], 'Done', 0 ] ); $result = $this->bag->set( '42xyz42', 'postdata' ); @@ -82,6 +87,7 @@ class RESTBagOStuffTest extends MediaWikiTestCase { $this->client->expects( $this->once() )->method( 'run' )->with( [ 'method' => 'DELETE', 'url' => 'http://test/rest/42xyz42', + 'headers' => [] // list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) ] )->willReturn( [ 200, 'OK', [], 'Done', 0 ] ); $result = $this->bag->delete( '42xyz42' );