mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
Update HostingSubscriptionBackupTest.php
This commit is contained in:
parent
ba0dc7f236
commit
7636ef38b2
1 changed files with 35 additions and 8 deletions
|
@ -87,7 +87,9 @@ class HostingSubscriptionBackupTest extends ActionTestCase
|
|||
$this->assertSame(Helpers::checkPathSize($findBackup->path), $findBackup->size);
|
||||
|
||||
Helpers::extractTar($findBackup->filepath, $findBackup->path . '/unit-test');
|
||||
|
||||
//
|
||||
// dd($chs);
|
||||
// dd($findBackup->path);
|
||||
|
||||
}
|
||||
|
||||
|
@ -162,25 +164,50 @@ class HostingSubscriptionBackupTest extends ActionTestCase
|
|||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::connection($unitTestDbConnection)
|
||||
->create('second_random_table', function ($table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
$this->assertTrue(Schema::connection($unitTestDbConnection)
|
||||
->hasTable('random_table'));
|
||||
|
||||
$this->assertTrue(Schema::connection($unitTestDbConnection)
|
||||
->hasTable('second_random_table'));
|
||||
|
||||
$databaseTableData = [];
|
||||
for ($i = 0; $i < 200; $i++) {
|
||||
$databaseData = [
|
||||
'name' => 'UnitBackupTest' . time() . $i,
|
||||
'email' => 'UnitBackupTest' . time() . $i . '@unit-test.com',
|
||||
'phone' => time(),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
];
|
||||
$databaseTableData['random_table'][] = $databaseData;
|
||||
$databaseTableData['second_random_table'][] = $databaseData;
|
||||
|
||||
DB::connection($unitTestDbConnection)
|
||||
->table('random_table')
|
||||
->insert([
|
||||
'name' => 'UnitBackupTest' . time() . $i,
|
||||
'email' => 'UnitBackupTest' . time() . $i . '@unit-test.com',
|
||||
'phone' => time(),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
->insert($databaseData);
|
||||
|
||||
DB::connection($unitTestDbConnection)
|
||||
->table('second_random_table')
|
||||
->insert($databaseData);
|
||||
}
|
||||
|
||||
return [
|
||||
'customerId' => $customer->id,
|
||||
'hostingPlanId' => $hostingPlan->id,
|
||||
'hostingSubscriptionId' => $hostingSubscription->id,
|
||||
'databaseId' => $database->id,
|
||||
'databaseUserId' => $databaseUser->id,
|
||||
'databaseConnection' => $unitTestDbConnection,
|
||||
'databaseTableData' => $databaseTableData
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue