Skip to content

Commit

Permalink
WIP: test changing Carbon::setTestNow
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Aug 24, 2024
1 parent ebd4da0 commit e7ceaff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/BackupTablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function test_generate_single_table_backup_then_another_table_backup_late

$this->assertTrue(Schema::hasTable($newSonTable));
$this->assertEquals(DB::table('sons')->value('father_id'), DB::table($newSonTable)->value('father_id'));
Carbon::setTestNow(now());
Carbon::setTestNow();
}

public function test_generate_multiple_table_backup()
Expand Down Expand Up @@ -197,7 +197,7 @@ public function test_generate_single_table_backup_with_with_custom_format()
{
dump([7 => __FUNCTION__]);

Carbon::setTestNow();
Carbon::setTestNow(now());
$tableName = 'fathers';
$customFormat = 'Y_d_m_H_i';

Expand All @@ -206,6 +206,8 @@ public function test_generate_single_table_backup_with_with_custom_format()
$newTableName = $tableName.'_backup_'.now()->format($customFormat);

$this->assertTrue(Schema::hasTable($newTableName));
Carbon::setTestNow();

}

//public function test_generate_multiple_models_backup()
Expand Down

0 comments on commit e7ceaff

Please sign in to comment.