Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2485077
PaymentMandateDisabledEmailTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PaymentMandateDisabledEmailTest.php
View Options
<?php
namespace
Tests\Feature\Jobs
;
use
App\Jobs\PaymentMandateDisabledEmail
;
use
App\Mail\PaymentMandateDisabled
;
use
App\User
;
use
Illuminate\Support\Facades\Mail
;
use
Tests\TestCase
;
class
PaymentMandateDisabledEmailTest
extends
TestCase
{
/**
* {@inheritDoc}
*
* @return void
*/
public
function
setUp
():
void
{
parent
::
setUp
();
$this
->
deleteTestUser
(
'PaymentEmail@UserAccount.com'
);
}
/**
* {@inheritDoc}
*
* @return void
*/
public
function
tearDown
():
void
{
$this
->
deleteTestUser
(
'PaymentEmail@UserAccount.com'
);
parent
::
tearDown
();
}
/**
* Test job handle
*
* @return void
*/
public
function
testHandle
()
{
$status
=
User
::
STATUS_ACTIVE
|
User
::
STATUS_LDAP_READY
|
User
::
STATUS_IMAP_READY
;
$user
=
$this
->
getTestUser
(
'PaymentEmail@UserAccount.com'
,
[
'status'
=>
$status
]);
$user
->
setSetting
(
'external_email'
,
'ext@email.tld'
);
$wallet
=
$user
->
wallets
()->
first
();
Mail
::
fake
();
// Assert that no jobs were pushed...
Mail
::
assertNothingSent
();
$job
=
new
PaymentMandateDisabledEmail
(
$wallet
);
$job
->
handle
();
// Assert the email sending job was pushed once
Mail
::
assertSent
(
PaymentMandateDisabled
::
class
,
1
);
// Assert the mail was sent to the user's email
Mail
::
assertSent
(
PaymentMandateDisabled
::
class
,
function
(
$mail
)
{
return
$mail
->
hasTo
(
'ext@email.tld'
)
&&
!
$mail
->
hasCc
(
'ext@email.tld'
);
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Nov 20, 9:10 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387308
Default Alt Text
PaymentMandateDisabledEmailTest.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment