aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/Rest
diff options
context:
space:
mode:
authorDerick Alangi <alangiderick@gmail.com>2021-10-31 19:19:27 +0100
committerDerick Alangi <alangiderick@gmail.com>2021-11-03 13:15:19 +0100
commitefd780c31e5bee0bd083a8cc77cf9d71bfcdffcc (patch)
tree4dc2dee2961921b7cb12afac1fd0537a934a1899 /tests/phpunit/includes/Rest
parenta48b932e8e0d7906ffad3044e37c028790053845 (diff)
downloadmediawikicore-efd780c31e5bee0bd083a8cc77cf9d71bfcdffcc.tar.gz
mediawikicore-efd780c31e5bee0bd083a8cc77cf9d71bfcdffcc.zip
Convert response to string & fix `assertEquals()` to `assertSame()`
Actually, `->getBody()` returns a stream interface and in order to get the body's content, just call `->getContent()` which will return the response's body content in string format. Change-Id: I9527c8a29c8da2342c8ac958c4e7bb6ba12fd613
Diffstat (limited to 'tests/phpunit/includes/Rest')
-rw-r--r--tests/phpunit/includes/Rest/RequestFromGlobalsTest.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/phpunit/includes/Rest/RequestFromGlobalsTest.php b/tests/phpunit/includes/Rest/RequestFromGlobalsTest.php
index 5e094fef3457..117831dbec95 100644
--- a/tests/phpunit/includes/Rest/RequestFromGlobalsTest.php
+++ b/tests/phpunit/includes/Rest/RequestFromGlobalsTest.php
@@ -122,9 +122,7 @@ class RequestFromGlobalsTest extends MediaWikiIntegrationTestCase {
'HTTP_ACCEPT' => 'text/html'
] );
- // FIXME assertSame fails here
- // phpcs:ignore MediaWiki.PHPUnit.AssertEquals
- $this->assertEquals( '', $this->reqFromGlobals->getBody() );
+ $this->assertSame( '', $this->reqFromGlobals->getBody()->getContents() );
}
public function testGetServerParams() {