From b29257a2821f3b90a856beb213736d5033df17e4 Mon Sep 17 00:00:00 2001 From: Lennart Hengstmengel Date: Thu, 7 Oct 2021 10:26:35 +0200 Subject: [PATCH 1/2] fixed method signature --- tests/MatrixHttpApiTest.php | 3 ++- tests/UserTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/MatrixHttpApiTest.php b/tests/MatrixHttpApiTest.php index ef4d7ba..38f9f4b 100644 --- a/tests/MatrixHttpApiTest.php +++ b/tests/MatrixHttpApiTest.php @@ -51,7 +51,8 @@ class MatrixHttpApiTest extends BaseTestCase { */ protected $api; - protected function setUp() { + protected function setUp(): void + { parent::setUp(); $this->api = new MatrixHttpApi('http://example.com'); } diff --git a/tests/UserTest.php b/tests/UserTest.php index cbfe173..a7d98fc 100644 --- a/tests/UserTest.php +++ b/tests/UserTest.php @@ -26,7 +26,8 @@ class UserTest extends BaseTestCase { */ protected $room; - protected function setUp() { + protected function setUp(): void + { parent::setUp(); $this->client = new MatrixClient(self::HOSTNAME); $this->user = new User($this->client->api(), $this->userId); From ba600d22bd057c031c8254ddbdf7bb8a9f32fe34 Mon Sep 17 00:00:00 2001 From: Lennart Hengstmengel Date: Thu, 7 Oct 2021 10:27:09 +0200 Subject: [PATCH 2/2] correct assertion to check string containment --- tests/MatrixHttpApiTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/MatrixHttpApiTest.php b/tests/MatrixHttpApiTest.php index 38f9f4b..159d1dd 100644 --- a/tests/MatrixHttpApiTest.php +++ b/tests/MatrixHttpApiTest.php @@ -375,7 +375,7 @@ class MatrixHttpApiTest extends BaseTestCase { $req = array_get($container, '0.request'); $this->assertEquals('GET', $req->getMethod()); - $this->assertContains($this->token, $req->getRequestTarget()); + $this->assertStringContainsString($this->token, $req->getRequestTarget()); } public function testSendUserId() { @@ -391,7 +391,7 @@ class MatrixHttpApiTest extends BaseTestCase { $req = array_get($container, '0.request'); $this->assertEquals('GET', $req->getMethod()); - $this->assertContains(urlencode($this->userId), $req->getRequestTarget()); + $this->assertStringContainsString(urlencode($this->userId), $req->getRequestTarget()); } public function testSendUnsupMethod() { @@ -555,7 +555,7 @@ class MatrixHttpApiTest extends BaseTestCase { $req = array_get($container, '0.request'); $this->assertEquals('GET', $req->getMethod()); - $this->assertContains($req->getRequestTarget(), $whoamiUrl); + $this->assertStringContainsString($req->getRequestTarget(), $whoamiUrl); } public function testWhoamiUnauth() {