-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48f1ea3
commit c82b607
Showing
1 changed file
with
4 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,9 +37,9 @@ public function test_return_when_table_string_empty() | |
$this->assertFalse(BackupTables::generateBackup($emptyArray)); | ||
} | ||
|
||
public function test_generate_single_table_backup_with_proper_name() | ||
public function test_generate_single_table_backup() | ||
{ | ||
dump([2 => __FUNCTION__]); | ||
dump([3 => __FUNCTION__]); | ||
|
||
Carbon::setTestNow(); | ||
|
||
|
@@ -49,29 +49,7 @@ public function test_generate_single_table_backup_with_proper_name() | |
$newTableName = $tableName.'_backup_'.now()->format('Y_m_d_H_i_s'); | ||
|
||
$this->assertTrue(Schema::hasTable($newTableName)); | ||
} | ||
|
||
|
||
public function test_generate_single_table_backup_all_table_data() | ||
{ | ||
dump([3=> __FUNCTION__]); | ||
|
||
Carbon::setTestNow(); | ||
$tableName = 'fathers'; | ||
|
||
Father::create([ | ||
'first_name' => 'Ahmed', | ||
'last_name' => 'Saleh', | ||
'email' => '[email protected]', | ||
]); | ||
|
||
BackupTables::generateBackup($tableName); | ||
|
||
$newTableName = $tableName.'_backup_'.now()->format('Y_m_d_H_i_s'); | ||
|
||
$this->assertTrue(Schema::hasTable($newTableName)); | ||
|
||
// todo Debugging output to inspect the contents of the backup table | ||
$backupData = DB::table($newTableName)->get(); | ||
dump([ | ||
DB::getDriverName(), | ||
|
@@ -121,7 +99,7 @@ public function test_generate_single_table_backup_with_different_data() | |
|
||
} | ||
|
||
public function test_generate_2_single_table_backup_all_table_data() | ||
public function test_generate_single_table_backup_then_another_table_backup_later() | ||
{ | ||
dump([5 => __FUNCTION__]); | ||
|
||
|
@@ -172,7 +150,7 @@ public function test_generate_2_single_table_backup_all_table_data() | |
|
||
public function test_generate_multiple_table_backup() | ||
{ | ||
dump([6 => __FUNCTION__]); | ||
dump([6=> __FUNCTION__]); | ||
|
||
Carbon::setTestNow(); | ||
$tableName = 'fathers'; | ||
|