mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-25 00:50:32 +00:00
Update HostingSubscriptionBackupTest.php
This commit is contained in:
parent
7636ef38b2
commit
133f472644
1 changed files with 16 additions and 1 deletions
|
@ -89,7 +89,22 @@ class HostingSubscriptionBackupTest extends ActionTestCase
|
|||
Helpers::extractTar($findBackup->filepath, $findBackup->path . '/unit-test');
|
||||
//
|
||||
// dd($chs);
|
||||
// dd($findBackup->path);
|
||||
$findDatabase = Database::where('id', $chs['databaseId'])->first();
|
||||
|
||||
$extractedDatabase = $findBackup->path . '/unit-test/' . $findDatabase->database_name_prefix . $findDatabase->database_name . '.sql';
|
||||
$this->assertTrue(file_exists($extractedDatabase));
|
||||
$extractedDatabaseContent = file_get_contents($extractedDatabase);
|
||||
$this->assertNotEmpty($extractedDatabaseContent);
|
||||
|
||||
foreach ($chs['databaseTableData'] as $tableName => $tableData) {
|
||||
$this->assertStringContainsString('CREATE TABLE `' . $tableName . '`', $extractedDatabaseContent);
|
||||
foreach ($tableData as $data) {
|
||||
$this->assertStringContainsString('INSERT INTO `' . $tableName . '`', $extractedDatabaseContent);
|
||||
$this->assertStringContainsString($data['name'], $extractedDatabaseContent);
|
||||
$this->assertStringContainsString($data['email'], $extractedDatabaseContent);
|
||||
$this->assertStringContainsString($data['phone'], $extractedDatabaseContent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue