Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120824587
SignupCodeTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
SignupCodeTest.php
View Options
<?php
namespace
Tests\Feature
;
use
App\SignupCode
;
use
Carbon\Carbon
;
use
Tests\TestCase
;
class
SignupCodeTest
extends
TestCase
{
/**
* Test SignupCode creation
*
* @return void
*/
public
function
testSignupCodeCreate
()
{
$data
=
[
'data'
=>
[
'email'
=>
'User@email.org'
,
]
];
$now
=
Carbon
::
now
();
$code
=
SignupCode
::
create
(
$data
);
$code_length
=
env
(
'VERIFICATION_CODE_LENGTH'
,
SignupCode
::
SHORTCODE_LENGTH
);
$exp
=
Carbon
::
now
()->
addHours
(
env
(
'SIGNUP_CODE_EXPIRY'
,
SignupCode
::
CODE_EXP_HOURS
));
$this
->
assertFalse
(
$code
->
isExpired
());
$this
->
assertTrue
(
strlen
(
$code
->
code
)
===
SignupCode
::
CODE_LENGTH
);
$this
->
assertTrue
(
strlen
(
$code
->
short_code
)
===
$code_length
);
$this
->
assertSame
(
$data
[
'data'
],
$code
->
data
);
$this
->
assertInstanceOf
(
Carbon
::
class
,
$code
->
expires_at
);
$this
->
assertSame
(
$code
->
expires_at
->
toDateTimeString
(),
$exp
->
toDateTimeString
());
$inst
=
SignupCode
::
find
(
$code
->
code
);
$this
->
assertInstanceOf
(
SignupCode
::
class
,
$inst
);
$this
->
assertSame
(
$inst
->
code
,
$code
->
code
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 10:24 AM (23 h, 49 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b7/5c/c294b0b54da4a0f01416b21b8c1c
Default Alt Text
SignupCodeTest.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline