Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

chore: prepare for PR

Andras Bacsai620da191b124
diff --git a/app/Models/Application.php b/app/Models/Application.php
index d6c222a97a..28ef790786 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -990,7 +990,7 @@ class Application extends BaseModel
if (isDev() && data_get($this, 'private_key_id') === 0) {
return 'deploy_key';
}
- if (data_get($this, 'private_key_id')) {
+ if (! is_null(data_get($this, 'private_key_id'))) {
return 'deploy_key';
} elseif (data_get($this, 'source')) {
return 'source';
diff --git a/tests/Unit/ApplicationDeploymentTypeTest.php b/tests/Unit/ApplicationDeploymentTypeTest.php
new file mode 100644
index 0000000000..d240181f13
--- /dev/null
+++ b/tests/Unit/ApplicationDeploymentTypeTest.php
@@ -0,0 +1,11 @@
+<?php
+
+use App\Models\Application;
+
+it('treats zero private key id as deploy key', function () {
+ $application = new Application();
+ $application->private_key_id = 0;
+ $application->source = null;
+
+ expect($application->deploymentType())->toBe('deploy_key');
+});