This commit is contained in:
Bozhidar 2024-05-14 16:08:01 +03:00
parent b3c9d77861
commit e3598384ca
2 changed files with 30 additions and 23 deletions

View file

@ -15,6 +15,9 @@ class ApacheVirtualHostManager
{
$allConfigs = [];
foreach ($this->registerConfigs as $module => $configs) {
if (empty($forModules)) {
continue;
}
if (! in_array($module, $forModules)) {
continue;
}

View file

@ -46,33 +46,38 @@ class HostingSubscriptionWithNodeJSCreateTest extends ActionTestCase
{
$this->assertTrue(Str::contains(php_uname(),'Ubuntu'));
//
// Make Apache+PHP Application Server with all supported php versions and modules
$installLogFilePath = storage_path('install-apache-nodejs-log-unit-test.txt');
if (is_file($installLogFilePath)) {
unlink($installLogFilePath);
}
$phpInstaller = new NodeJsInstaller();
$phpInstaller->setNodeJsVersions(array_keys(SupportedApplicationTypes::getNodeJsVersions()));
$phpInstaller->setLogFilePath($installLogFilePath);
$phpInstaller->install();
$isNodeJsInstalled = false;
$installationSuccess = false;
for ($i = 1; $i <= 100; $i++) {
$logContent = file_get_contents($installLogFilePath);
if (str_contains($logContent, 'All packages installed successfully!')) {
$installationSuccess = true;
break;
if (!$isNodeJsInstalled) {
// Make Apache+NodeJS Application Server with all supported php versions and modules
$installLogFilePath = storage_path('install-apache-nodejs-log-unit-test.txt');
if (is_file($installLogFilePath)) {
unlink($installLogFilePath);
}
sleep(3);
}
if (!$installationSuccess) {
$logContent = file_get_contents($installLogFilePath);
$this->fail('Apache+NodeJS installation failed. Log: '.$logContent);
}
$nodeJSInstaller = new NodeJsInstaller();
$nodeJSInstaller->setNodeJsVersions(array_keys(SupportedApplicationTypes::getNodeJsVersions()));
$nodeJSInstaller->setLogFilePath($installLogFilePath);
$nodeJSInstaller->install();
$this->assertTrue($installationSuccess, 'Apache+NodeJS installation failed');
$installationSuccess = false;
for ($i = 1; $i <= 100; $i++) {
$logContent = file_get_contents($installLogFilePath);
if (str_contains($logContent, 'All packages installed successfully!')) {
$installationSuccess = true;
break;
}
sleep(3);
}
if (!$installationSuccess) {
$logContent = file_get_contents($installLogFilePath);
$this->fail('Apache+NodeJS installation failed. Log: ' . $logContent);
}
$this->assertTrue($installationSuccess, 'Apache+NodeJS installation failed');
}
// Make unauthorized call
$callUnauthorizedResponse = $this->callRouteAction('api.hosting-subscriptions.store')->json();
@ -125,7 +130,6 @@ class HostingSubscriptionWithNodeJSCreateTest extends ActionTestCase
$hostingPlanId = $createHostingPlan->id;
$hostingSubscriptionDomain = 'phyre-unit-test-'.$randId.'.com';
$callHostingSubscriptionStoreResponse = $this->callApiAuthorizedRouteAction(
'api.hosting-subscriptions.store',