This repository was archived by the owner on Oct 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tests/integration/ApiClient Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments