mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-09-19 23:31:12 +00:00
update
This commit is contained in:
parent
85d1d1bc2a
commit
6d76e0d19c
|
@ -4,6 +4,14 @@ namespace App;
|
||||||
|
|
||||||
class Helpers
|
class Helpers
|
||||||
{
|
{
|
||||||
|
public static function extractTar($tarFile, $extractPath)
|
||||||
|
{
|
||||||
|
shell_exec('mkdir -p ' . $extractPath);
|
||||||
|
|
||||||
|
$exec = shell_exec('tar -xvf ' . $tarFile . ' -C ' . $extractPath);
|
||||||
|
|
||||||
|
return $exec;
|
||||||
|
}
|
||||||
|
|
||||||
public static function checkPathSize($path)
|
public static function checkPathSize($path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,9 +65,16 @@ class BackupTest extends ActionTestCase
|
||||||
|
|
||||||
$getFilesize = filesize($findBackup->filepath);
|
$getFilesize = filesize($findBackup->filepath);
|
||||||
$this->assertGreaterThan(0, $getFilesize);
|
$this->assertGreaterThan(0, $getFilesize);
|
||||||
|
|
||||||
$this->assertSame(Helpers::checkPathSize($findBackup->path), $findBackup->size);
|
$this->assertSame(Helpers::checkPathSize($findBackup->path), $findBackup->size);
|
||||||
|
|
||||||
|
Helpers::extractTar($findBackup->filepath, $findBackup->path . '/unit-test');
|
||||||
|
|
||||||
|
$this->assertTrue(is_dir($findBackup->path . '/unit-test'));
|
||||||
|
$this->assertTrue(is_dir($findBackup->path . '/unit-test/' . $hostingSubscription->system_username));
|
||||||
|
$this->assertTrue(is_dir($findBackup->path . '/unit-test/' . $hostingSubscription->system_username . '/public_html'));
|
||||||
|
$this->assertTrue(is_dir($findBackup->path . '/unit-test/' . $hostingSubscription->system_username . '/public_html/cgi-bin'));
|
||||||
|
$this->assertTrue(is_file($findBackup->path . '/unit-test/' . $hostingSubscription->system_username . '/public_html/index.php'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue