From c3e5b4ba734129d32ec7ef55ee5c5e6d3a3d14bf Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 3 Nov 2026 22:34:25 +0100 Subject: [PATCH] test(env): cover spaced shared variable inside a longer value (#7202) --- .../EnvironmentVariableSharedSpacingTest.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Feature/EnvironmentVariable/EnvironmentVariableSharedSpacingTest.php b/tests/Feature/EnvironmentVariable/EnvironmentVariableSharedSpacingTest.php index 6f94d0143f..60d17949c5 100644 --- a/tests/Feature/EnvironmentVariable/EnvironmentVariableSharedSpacingTest.php +++ b/tests/Feature/EnvironmentVariable/EnvironmentVariableSharedSpacingTest.php @@ -76,6 +76,26 @@ test('shared variable with spaces resolves correctly', function () { expect($realValue)->toBe('test-value-123'); }); +test('spaced shared variable inside a longer value resolves for the container (#7202)', function () { + SharedEnvironmentVariable::create([ + 'key' => 'DOMAIN', + 'value' => 'example.com', + 'type' => 'project', + 'project_id' => $this->project->id, + 'team_id' => $this->team->id, + ]); + + $env = EnvironmentVariable::create([ + 'key' => 'PUBLIC_APIURL', + 'value' => 'https://{{ project.DOMAIN }}/api', + 'resourceable_id' => $this->application->id, + 'resourceable_type' => $this->application->getMorphClass(), + ]); + + expect($env->real_value)->toBe('https://example.com/api') + ->and($env->getResolvedValueWithServer())->toBe('https://example.com/api'); +}); + test('shared variable without spaces resolves correctly', function () { // Create shared variable $shared = SharedEnvironmentVariable::create([