client->call(Client::METHOD_GET, '/users/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ 'range' => '32h', ]); $this->assertEquals($response['headers']['status-code'], 400); /** * Test for SUCCESS */ $response = $this->client->call(Client::METHOD_GET, '/users/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ 'range' => '24h', ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(5, count($response['body'])); $this->assertEquals('24h', $response['body']['range']); $this->assertIsNumeric($response['body']['usersTotal']); $this->assertIsNumeric($response['body']['sessionsTotal']); $this->assertIsArray($response['body']['users']); $this->assertIsArray($response['body']['sessions']); } }