mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-05 02:20:28 -05:00
adding test for deprovisioning notification using date format (#7065)
This commit is contained in:
@@ -520,13 +520,22 @@ class NotificationContext implements Context {
|
||||
* @When user :user tries to create a deprovisioning notification
|
||||
*
|
||||
* @param string|null $user
|
||||
* @param string|null $deprovision_date
|
||||
* @param string|null $deprovision_date_format
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws GuzzleException
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function userCreatesDeprovisioningNotification(?string $user = null):void {
|
||||
public function userCreatesDeprovisioningNotification(
|
||||
?string $user = null,
|
||||
?string $deprovision_date = "2043-07-04T11:23:12Z",
|
||||
?string $deprovision_date_format= "2006-01-02T15:04:05Z07:00"
|
||||
):void {
|
||||
$payload["type"] = "deprovision";
|
||||
$payload["data"] = ["deprovision_date" => "2043-07-04T11:23:12Z"];
|
||||
|
||||
$payload["data"] = ["deprovision_date" => $deprovision_date, "deprovision_date_format" => $deprovision_date_format];
|
||||
$response = OcsApiHelper::sendRequest(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user ? $this->featureContext->getActualUsername($user) : $this->featureContext->getAdminUsername(),
|
||||
@@ -540,6 +549,21 @@ class NotificationContext implements Context {
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator creates a deprovisioning notification for date :deprovision_date of format :deprovision_date_format
|
||||
*
|
||||
* @param $deprovision_date
|
||||
* @param $deprovision_date_format
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws GuzzleException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function theAdministratorCreatesADeprovisioningNotificationUsingDateFormat($deprovision_date, $deprovision_date_format) {
|
||||
$this->userCreatesDeprovisioningNotification(null, $deprovision_date, $deprovision_date_format);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has created a deprovisioning notification
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user