mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add another case scenario
This commit is contained in:
parent
ce31ce477e
commit
d1197d015c
|
@ -48,12 +48,31 @@ class AssetAcceptanceReminderTest extends TestCase
|
||||||
Mail::assertNotSent(CheckoutAssetMail::class);
|
Mail::assertNotSent(CheckoutAssetMail::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUserWithoutEmailAddressHandledGracefully()
|
public static function CheckoutAcceptancesToUsersWithoutEmailAddresses()
|
||||||
{
|
{
|
||||||
$checkoutAcceptance = CheckoutAcceptance::factory()
|
yield 'User with null email address' => [
|
||||||
|
function () {
|
||||||
|
return CheckoutAcceptance::factory()
|
||||||
->pending()
|
->pending()
|
||||||
->forAssignedTo(['email' => null])
|
->forAssignedTo(['email' => null])
|
||||||
->create();
|
->create();
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
yield 'User with empty string email address' => [
|
||||||
|
function () {
|
||||||
|
return CheckoutAcceptance::factory()
|
||||||
|
->pending()
|
||||||
|
->forAssignedTo(['email' => ''])
|
||||||
|
->create();
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
#[DataProvider('CheckoutAcceptancesToUsersWithoutEmailAddresses')]
|
||||||
|
public function testUserWithoutEmailAddressHandledGracefully($callback)
|
||||||
|
{
|
||||||
|
$checkoutAcceptance = $callback();
|
||||||
|
|
||||||
$this->actingAs(User::factory()->canViewReports()->create())
|
$this->actingAs(User::factory()->canViewReports()->create())
|
||||||
->post($this->routeFor($checkoutAcceptance))
|
->post($this->routeFor($checkoutAcceptance))
|
||||||
|
|
Loading…
Reference in a new issue