testing \Froxlor\Settings\FroxlorVhostSettings

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-06-06 13:04:43 +02:00
parent d8a8f76dc9
commit f266bb05c9

View File

@@ -4,6 +4,7 @@ use PHPUnit\Framework\TestCase;
/**
*
* @covers \Froxlor\Settings
* @covers \Froxlor\Settings\FroxlorVhostSettings
*/
class SettingsTest extends TestCase
{
@@ -92,4 +93,21 @@ class SettingsTest extends TestCase
$result = \Froxlor\Settings::IsInList("system.mysql_access_host", "my-super-domain.de");
$this->assertFalse($result);
}
public function testFroxlorVhostSettings()
{
// bootstrap.php adds two IPs, one ssl one non-ssl both with vhostcontainer = 1
$result = \Froxlor\Settings\FroxlorVhostSettings::hasVhostContainerEnabled(false);
$this->assertTrue($result);
$result = \Froxlor\Settings\FroxlorVhostSettings::hasVhostContainerEnabled(true);
$this->assertTrue($result);
// now disable both
\Froxlor\Database\Database::query("UPDATE `". TABLE_PANEL_IPSANDPORTS . "` SET `vhostcontainer` = '0'");
$result = \Froxlor\Settings\FroxlorVhostSettings::hasVhostContainerEnabled(false);
$this->assertFalse($result);
$result = \Froxlor\Settings\FroxlorVhostSettings::hasVhostContainerEnabled(true);
$this->assertFalse($result);
// and change back
\Froxlor\Database\Database::query("UPDATE `". TABLE_PANEL_IPSANDPORTS . "` SET `vhostcontainer` = '1'");
}
}