Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F8223720
SignupVerificationTest.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
SignupVerificationTest.php
View Options
<?php
namespace
Tests\Unit\Mail
;
use
App\Mail\SignupVerification
;
use
App\SignupCode
;
use
App\Utils
;
use
Tests\MailInterceptTrait
;
use
Tests\TestCase
;
class
SignupVerificationTest
extends
TestCase
{
use
MailInterceptTrait
;
/**
* Test email content
*/
public
function
testBuild
():
void
{
$code
=
new
SignupCode
([
'code'
=>
'code'
,
'short_code'
=>
'short-code'
,
'data'
=>
[
'email'
=>
'test@email'
,
'first_name'
=>
'First'
,
'last_name'
=>
'Last'
,
],
]);
$mail
=
$this
->
fakeMail
(
new
SignupVerification
(
$code
));
$html
=
$mail
[
'html'
];
$plain
=
$mail
[
'plain'
];
$url
=
Utils
::
serviceUrl
(
'/signup/'
.
$code
->
short_code
.
'-'
.
$code
->
code
);
$link
=
"<a href=
\"
$url
\"
>$url</a>"
;
$appName
=
\config
(
'app.name'
);
$this
->
assertMailSubject
(
"$appName Registration"
,
$mail
[
'message'
]);
$this
->
assertStringStartsWith
(
'<!DOCTYPE html>'
,
$html
);
$this
->
assertTrue
(
strpos
(
$html
,
$link
)
>
0
);
$this
->
assertTrue
(
strpos
(
$html
,
'First Last'
)
>
0
);
$this
->
assertStringStartsWith
(
'Dear First Last'
,
$plain
);
$this
->
assertTrue
(
strpos
(
$plain
,
$url
)
>
0
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Jul 9, 9:26 PM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1057143
Default Alt Text
SignupVerificationTest.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment