Merge pull request #10 from vazaha-nl/test-fixes

Fixed function signature error and failing tests
This commit is contained in:
Yoann Celton 2021-10-07 20:34:17 +11:00 committed by GitHub
commit 396376ceb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -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');
}
@ -374,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() {
@ -390,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() {
@ -554,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() {

View File

@ -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);