Skip to content

Commit 73ccd71

Browse files
committed
Add test & live clientId to ImportProject
1 parent 3218ec3 commit 73ccd71

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

src/Project/Command/ImportProject.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public function __construct(
6262
int $groupId,
6363
string $testApiKeySapi3,
6464
string $liveApiKeySapi3,
65+
string $testClientId,
66+
string $liveClientId,
6567
string $state
6668
) {
6769
$this->platformUuid = $platformUuid;
@@ -71,6 +73,8 @@ public function __construct(
7173
$this->groupId = $groupId;
7274
$this->testApiKeySapi3 = $testApiKeySapi3;
7375
$this->liveApiKeySapi3 = $liveApiKeySapi3;
76+
$this->testClientId = $testClientId;
77+
$this->liveClientId = $liveClientId;
7478
$this->state = $state;
7579
}
7680

src/Project/CommandHandler/ImportProjectCommandHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function handle(ImportProject $importProject): void
3939
$project->setPlatformUuid($importProject->getPlatformUuid());
4040
$project->setTestApiKeySapi3($importProject->getTestApiKeySapi3());
4141
$project->setLiveApiKeySapi3($importProject->getLiveApiKeySapi3());
42+
$project->setTestClientId($importProject->getTestClientId());
43+
$project->setLiveClientId($importProject->getLiveClientId());
4244
}
4345
$project->setName($importProject->getName());
4446
$project->setDescription($importProject->getDescription());

src/Project/Controller/ImportProjectController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function importProject(string $uuid, Request $request): JsonResponse
2626
$postedProject = json_decode($request->getContent());
2727

2828
$this->validate(
29-
['userId', 'name', 'summary', 'groupId', 'testApiKeySapi3', 'liveApiKeySapi3', 'state'],
29+
['userId', 'name', 'summary', 'groupId', 'testApiKeySapi3', 'liveApiKeySapi3', 'testClientId', 'liveClientId', 'state'],
3030
$postedProject
3131
);
3232

@@ -39,6 +39,8 @@ public function importProject(string $uuid, Request $request): JsonResponse
3939
$postedProject->groupId,
4040
$postedProject->testApiKeySapi3,
4141
$postedProject->liveApiKeySapi3,
42+
$postedProject->testClientId,
43+
$postedProject->liveClientId,
4244
$postedProject->state
4345
)
4446
);

test/Project/CommandHandler/ImportProjectCommandHandlerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function testHandleNewImport(): void
6868
24378,
6969
'SAPI3 test key',
7070
'SAPI3 live key',
71+
'Test client id',
72+
'Live client id',
7173
'active'
7274
);
7375

@@ -79,6 +81,8 @@ public function testHandleNewImport(): void
7981
$project->setPlatformUuid($importProject->getPlatformUuid());
8082
$project->setTestApiKeySapi3($importProject->getTestApiKeySapi3());
8183
$project->setLiveApiKeySapi3($importProject->getLiveApiKeySapi3());
84+
$project->setTestClientId($importProject->getTestClientId());
85+
$project->setLiveClientId($importProject->getLiveClientId());
8286
$project->setStatus(Project::PROJECT_STATUS_ACTIVE);
8387

8488
$this->logger->expects($this->exactly(2))
@@ -101,6 +105,8 @@ public function testHandleUpdateImport(): void
101105
24378,
102106
'SAPI3 test key',
103107
'SAPI3 live key',
108+
'Test client id',
109+
'Live client id',
104110
'active'
105111
);
106112

0 commit comments

Comments
 (0)