fixes multi currency tests

This commit is contained in:
hackerESQ
2025-04-11 20:57:21 -05:00
parent 26e54fb357
commit 38a65f99c9
6 changed files with 71 additions and 44 deletions
+4 -2
View File
@@ -241,9 +241,11 @@ class DailyChangeTest extends TestCase
'transaction_type' => 'BUY',
]);
$daily_change_day_after = DailyChange::withDailyPerformance()->whereDate('daily_change.date', $third_transaction->date->addDay())->first();
$daily_change_day_before = DailyChange::withDailyPerformance()->whereDate('daily_change.date', $third_transaction->date->subDay())->first();
$daily_change_day_after = DailyChange::withDailyPerformance()->whereDate('daily_change.date', $third_transaction->date->nextWeekday())->first();
$daily_change_day_before = DailyChange::withDailyPerformance()->whereDate('daily_change.date', $third_transaction->date->previousWeekday())->first();
$this->assertNotNull($daily_change_day_after);
$this->assertNotNull($daily_change_day_before);
$this->assertEquals(39.89, $daily_change_day_after->total_cost_basis - $daily_change_day_before->total_cost_basis);
}
}