diff --git a/tests/Unit/Jobs/FetchConversionRateTest.php b/tests/Unit/Jobs/FetchConversionRateTest.php new file mode 100644 index 00000000..8801e41e --- /dev/null +++ b/tests/Unit/Jobs/FetchConversionRateTest.php @@ -0,0 +1,35 @@ +assertDatabaseEmpty(ConversionRate::class); + + app()->call([new FetchConversionRate(1), 'handle']); + + $this->assertDatabaseHas( + ConversionRate::class, + [ + 'base_currency_id' => 1, + 'target_currency_id' => 2, + ], + ); + + $this->assertDatabaseHas( + ConversionRate::class, + [ + 'base_currency_id' => 1, + 'target_currency_id' => 3, + ], + ); + + // etc. + } +} diff --git a/tests/Unit/Jobs/FetchConversionRatesTest.php b/tests/Unit/Jobs/FetchConversionRatesTest.php new file mode 100644 index 00000000..e52fd015 --- /dev/null +++ b/tests/Unit/Jobs/FetchConversionRatesTest.php @@ -0,0 +1,22 @@ +call([new FetchConversionRates(), 'handle']); + + Queue::assertPushed(FetchConversionRate::class); + } +}