Update tests
This commit is contained in:
parent
afba7f75f0
commit
142e92b4b8
2 changed files with 27 additions and 5 deletions
|
@ -2026,6 +2026,9 @@ trait Base
|
||||||
messagingCreateTopic(topicId: $topicId, name: $name) {
|
messagingCreateTopic(topicId: $topicId, name: $name) {
|
||||||
_id
|
_id
|
||||||
name
|
name
|
||||||
|
emailTotal
|
||||||
|
smsTotal
|
||||||
|
pushTotal
|
||||||
}
|
}
|
||||||
}';
|
}';
|
||||||
case self::$LIST_TOPICS:
|
case self::$LIST_TOPICS:
|
||||||
|
@ -2035,6 +2038,9 @@ trait Base
|
||||||
topics {
|
topics {
|
||||||
_id
|
_id
|
||||||
name
|
name
|
||||||
|
emailTotal
|
||||||
|
smsTotal
|
||||||
|
pushTotal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}';
|
}';
|
||||||
|
@ -2043,6 +2049,9 @@ trait Base
|
||||||
messagingGetTopic(topicId: $topicId) {
|
messagingGetTopic(topicId: $topicId) {
|
||||||
_id
|
_id
|
||||||
name
|
name
|
||||||
|
emailTotal
|
||||||
|
smsTotal
|
||||||
|
pushTotal
|
||||||
}
|
}
|
||||||
}';
|
}';
|
||||||
case self::$UPDATE_TOPIC:
|
case self::$UPDATE_TOPIC:
|
||||||
|
@ -2050,6 +2059,9 @@ trait Base
|
||||||
messagingUpdateTopic(topicId: $topicId, name: $name) {
|
messagingUpdateTopic(topicId: $topicId, name: $name) {
|
||||||
_id
|
_id
|
||||||
name
|
name
|
||||||
|
emailTotal
|
||||||
|
smsTotal
|
||||||
|
pushTotal
|
||||||
}
|
}
|
||||||
}';
|
}';
|
||||||
case self::$DELETE_TOPIC:
|
case self::$DELETE_TOPIC:
|
||||||
|
|
|
@ -355,7 +355,9 @@ trait MessagingBase
|
||||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||||
], [
|
], [
|
||||||
'queries' => [
|
'queries' => [
|
||||||
Query::equal('total', [0])->toString(),
|
Query::equal('emailTotal', [0])->toString(),
|
||||||
|
Query::equal('smsTotal', [0])->toString(),
|
||||||
|
Query::equal('pushTotal', [0])->toString(),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -368,7 +370,9 @@ trait MessagingBase
|
||||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||||
], [
|
], [
|
||||||
'queries' => [
|
'queries' => [
|
||||||
Query::greaterThan('total', 0)->toString(),
|
Query::greaterThan('emailTotal', 0)->toString(),
|
||||||
|
Query::greaterThan('smsTotal', 0)->toString(),
|
||||||
|
Query::greaterThan('pushTotal', 0)->toString(),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -390,7 +394,9 @@ trait MessagingBase
|
||||||
]);
|
]);
|
||||||
$this->assertEquals(200, $response['headers']['status-code']);
|
$this->assertEquals(200, $response['headers']['status-code']);
|
||||||
$this->assertEquals('android-app', $response['body']['name']);
|
$this->assertEquals('android-app', $response['body']['name']);
|
||||||
$this->assertEquals(0, $response['body']['total']);
|
$this->assertEquals(0, $response['body']['emailTotal']);
|
||||||
|
$this->assertEquals(0, $response['body']['smsTotal']);
|
||||||
|
$this->assertEquals(0, $response['body']['pushTotal']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -446,7 +452,9 @@ trait MessagingBase
|
||||||
|
|
||||||
$this->assertEquals(200, $topic['headers']['status-code']);
|
$this->assertEquals(200, $topic['headers']['status-code']);
|
||||||
$this->assertEquals('android-app', $topic['body']['name']);
|
$this->assertEquals('android-app', $topic['body']['name']);
|
||||||
$this->assertEquals(1, $topic['body']['total']);
|
$this->assertEquals(1, $topic['body']['emailTotal']);
|
||||||
|
$this->assertEquals(0, $topic['body']['smsTotal']);
|
||||||
|
$this->assertEquals(0, $topic['body']['pushTotal']);
|
||||||
|
|
||||||
$response2 = $this->client->call(Client::METHOD_POST, '/messaging/topics/' . $topics['private']['$id'] . '/subscribers', \array_merge([
|
$response2 = $this->client->call(Client::METHOD_POST, '/messaging/topics/' . $topics['private']['$id'] . '/subscribers', \array_merge([
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
|
@ -695,7 +703,9 @@ trait MessagingBase
|
||||||
|
|
||||||
$this->assertEquals(200, $topic['headers']['status-code']);
|
$this->assertEquals(200, $topic['headers']['status-code']);
|
||||||
$this->assertEquals('android-app', $topic['body']['name']);
|
$this->assertEquals('android-app', $topic['body']['name']);
|
||||||
$this->assertEquals(0, $topic['body']['total']);
|
$this->assertEquals(0, $topic['body']['emailTotal']);
|
||||||
|
$this->assertEquals(0, $topic['body']['smsTotal']);
|
||||||
|
$this->assertEquals(0, $topic['body']['pushTotal']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue