Skip to content

Commit

Permalink
WIP: change tests order
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Aug 24, 2024
1 parent 48f1ea3 commit c82b607
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions tests/BackupTablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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(),
Expand Down Expand Up @@ -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__]);

Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit c82b607

Please sign in to comment.