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 3d281d9 commit ebd4da0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/BackupTablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public function test_generate_single_table_backup_then_another_table_backup_late
{
dump([5 => __FUNCTION__]);

Carbon::setTestNow();
Carbon::setTestNow(now());

$fatherTable = 'fathers';
$sonTable = 'sons';

Expand Down Expand Up @@ -148,13 +149,14 @@ 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());
}

public function test_generate_multiple_table_backup()
{
dump([6=> __FUNCTION__]);

Carbon::setTestNow();
Carbon::setTestNow(now());
$tableName = 'fathers';
$tableName2 = 'sons';

Expand Down Expand Up @@ -185,6 +187,8 @@ public function test_generate_multiple_table_backup()
}

$this->assertEquals(DB::table($tableName2)->value('father_id'), DB::table($newTableName2)->value('father_id')); // foreign key

Carbon::setTestNow();
}


Expand Down

0 comments on commit ebd4da0

Please sign in to comment.