1
0
Fork 0
mirror of synced 2024-10-02 18:26:49 +13:00
This commit is contained in:
prateek banga 2023-08-24 01:55:08 +05:30
parent ec54000263
commit a95c29d546
5 changed files with 12 additions and 13 deletions

View file

@ -1906,7 +1906,7 @@ App::get('/v1/account/targets/:targetId')
->param('targetId', '', new UID(), 'Target ID.')
->inject('user')
->inject('response')
->action(function (string $targetId, Document $user, Response $response) {
->action(function (string $targetId, Document $user, Response $response) {
$target = $user->find('$id', $targetId, 'targets');

View file

@ -1256,7 +1256,7 @@ App::patch('/v1/users/:userId/targets/:targetId/identifier')
$events
->setParam('userId', $userId)
->setParam ('targetId', $targetId);
->setParam('targetId', $targetId);
$response
->dynamic($target, Response::MODEL_TARGET);

View file

@ -119,7 +119,7 @@ class AccountCustomClientTest extends Scope
/**
* @depends testCreateAccountSession
*/
public function testCreateAccountTarget(array $data): array
public function testCreateAccountTarget(array $data): array
{
$session = $data['session'] ?? '';
$apiKey = $this->getProject()['apiKey'];
@ -156,7 +156,7 @@ class AccountCustomClientTest extends Scope
{
$session = $data['session'] ?? '';
$target = $data['target'];
$response = $this->client->call(Client::METHOD_PATCH, '/account/targets/' . $target['$id'] .'/identifier', array_merge([
$response = $this->client->call(Client::METHOD_PATCH, '/account/targets/' . $target['$id'] . '/identifier', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
@ -193,7 +193,7 @@ class AccountCustomClientTest extends Scope
$session = $data['session'] ?? '';
$target = $data['target'];
$response = $this->client->call(Client::METHOD_GET, '/account/targets/' .$target['$id'], array_merge([
$response = $this->client->call(Client::METHOD_GET, '/account/targets/' . $target['$id'], array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
@ -211,7 +211,7 @@ class AccountCustomClientTest extends Scope
$session = $data['session'] ?? '';
$target = $data['target'];
$response = $this->client->call(Client::METHOD_DELETE, '/account/targets/' .$target['$id'], array_merge([
$response = $this->client->call(Client::METHOD_DELETE, '/account/targets/' . $target['$id'], array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],

View file

@ -187,5 +187,4 @@ class MessagingServerTest extends Scope
$this->assertEquals(204, $response['headers']['status-code']);
}
}
}

View file

@ -1214,7 +1214,7 @@ trait UsersBase
/**
* @depends testGetUser
*/
public function testCreateUserTarget(array $data): array
public function testCreateUserTarget(array $data): array
{
$provider = $this->client->call(Client::METHOD_POST, '/messaging/providers/sendgrid', [
'content-type' => 'application/json',
@ -1239,13 +1239,13 @@ trait UsersBase
$this->assertEquals('my-token', $response['body']['identifier']);
return $response['body'];
}
/**
* @depends testCreateUserTarget
*/
public function testUpdateUserTarget(array $data): array
{
$response = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/targets/' . $data['$id'] .'/identifier', array_merge([
$response = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/targets/' . $data['$id'] . '/identifier', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
@ -1256,7 +1256,7 @@ trait UsersBase
$this->assertEquals('my-updated-token', $response['body']['identifier']);
return $response['body'];
}
/**
* @depends testGetUser
*/
@ -1276,7 +1276,7 @@ trait UsersBase
*/
public function testGetUserTarget(array $data)
{
$response = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'] . '/targets/' .$data['$id'], array_merge([
$response = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'] . '/targets/' . $data['$id'], array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
@ -1290,7 +1290,7 @@ trait UsersBase
*/
public function testDeleteUserTarget(array $data)
{
$response = $this->client->call(Client::METHOD_DELETE, '/users/' . $data['userId'] . '/targets/' .$data['$id'], array_merge([
$response = $this->client->call(Client::METHOD_DELETE, '/users/' . $data['userId'] . '/targets/' . $data['$id'], array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],