Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 9b9f741

Browse files
author
Barbara Palumbo
committed
test(ApiClient): modify test to add check on deleteAt and deleteDayAfterCreation
1 parent 6834a89 commit 9b9f741

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/integration/ApiClient/ApiClientTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,23 @@ public function testApiClient()
2222
{
2323
$client = $this->getClient(self::API_CLIENTS_SCOPE);
2424
$project = $client->getConfig()->getProject();
25+
$deleteDaysAfterCreation = 1;
2526

2627
$apiClientDraft = ApiClientDraft::ofNameAndScope(
2728
'test-' . $this->getTestRun(),
2829
'view_products:' . $project
29-
);
30+
)->setDeleteDaysAfterCreation($deleteDaysAfterCreation);
31+
3032
$request = ApiClientCreateRequest::ofDraft($apiClientDraft);
3133
$response = $request->executeWithClient($client);
32-
$result = $request->mapResponse($response);
34+
$result = $request->mapFromResponse($response);
3335

3436
$this->assertNotNull($result);
3537
$this->assertNotNull($result->getId());
38+
39+
$calcDate = date_modify(new \DateTime(), '+' . $deleteDaysAfterCreation . 'day');
40+
$this->assertEquals($calcDate->format('Y-m-d'), $result->getDeleteAt()->format('Y-m-d'));
41+
3642
$getByIdRequest = ApiClientByIdGetRequest::ofId($result->getId());
3743
$getResponse = $getByIdRequest->executeWithClient($client);
3844
$getResult = $request->mapResponse($getResponse);

0 commit comments

Comments
 (0)