Skip to content

Commit b6cbd49

Browse files
CLI-1596: Added ssh_url in CodebaseEnvironmentResponse. (#514)
* CLI-1596: Added ssh_url in CodebaseEnvironmentResponse. * CLI-1596: Added ssh_url Mutation Testing. * CLI-1596: Added ssh_url Mutation Testing.
1 parent aba83d3 commit b6cbd49

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/Response/CodebaseEnvironmentResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class CodebaseEnvironmentResponse
2020

2121
public string $code_switch_status;
2222

23+
public string $ssh_url;
24+
2325
public object $flags;
2426

2527
/**
@@ -41,6 +43,7 @@ public function __construct(object $environment)
4143
$this->status = $environment->status;
4244
$this->reference = $environment->reference;
4345
$this->code_switch_status = $environment->code_switch_status ?? 'IDLE';
46+
$this->ssh_url = $environment->ssh_url ?? '';
4447
$this->flags = $environment->flags;
4548
$this->properties = (array) ($environment->properties ?? []);
4649

tests/Endpoints/CodebaseEnvironmentsTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,5 +305,21 @@ public function testCodebaseEnvironmentResponseEdgeCases(): void
305305

306306
$response7 = new CodebaseEnvironmentResponse($environmentWithCodeSwitchStatus);
307307
$this->assertEquals('RUNNING', $response7->code_switch_status);
308+
// Test code_switch_status with explicit value
309+
$environmentWithSshUrl = (object) [
310+
'_links' => (object) ['self' => (object) ['href' => 'https://example.com']],
311+
'id' => 'env-7',
312+
'name' => 'dev4',
313+
'label' => 'Dev4',
314+
'description' => 'Development Environment 4',
315+
'status' => 'normal',
316+
'reference' => 'develop',
317+
'flags' => (object) ['production' => false],
318+
'code_switch_status' => 'RUNNING',
319+
'ssh_url' => 'ideapp.dev01@ideappdev01.ssh.gardens.acquia-sites.com'
320+
];
321+
322+
$response8 = new CodebaseEnvironmentResponse($environmentWithSshUrl);
323+
$this->assertEquals('ideapp.dev01@ideappdev01.ssh.gardens.acquia-sites.com', $response8->ssh_url);
308324
}
309325
}

0 commit comments

Comments
 (0)