Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F8199542
AuthAttemptTest.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
AuthAttemptTest.php
View Options
<?php
namespace
Tests\Feature
;
use
App\AuthAttempt
;
use
Tests\TestCase
;
class
AuthAttemptTest
extends
TestCase
{
/**
* {@inheritDoc}
*/
public
function
setUp
():
void
{
parent
::
setUp
();
$this
->
deleteTestUser
(
'jane@kolabnow.com'
);
}
/**
* {@inheritDoc}
*/
public
function
tearDown
():
void
{
$this
->
deleteTestUser
(
'jane@kolabnow.com'
);
parent
::
tearDown
();
}
public
function
testRecord
():
void
{
$user
=
$this
->
getTestUser
(
'jane@kolabnow.com'
);
$authAttempt
=
\App\AuthAttempt
::
recordAuthAttempt
(
$user
,
"10.0.0.1"
);
$this
->
assertEquals
(
$authAttempt
->
user_id
,
$user
->
id
);
$this
->
assertEquals
(
$authAttempt
->
ip
,
"10.0.0.1"
);
$authAttempt
->
refresh
();
$this
->
assertEquals
(
$authAttempt
->
status
,
"NEW"
);
$authAttempt2
=
\App\AuthAttempt
::
recordAuthAttempt
(
$user
,
"10.0.0.1"
);
$this
->
assertEquals
(
$authAttempt
->
id
,
$authAttempt2
->
id
);
$authAttempt3
=
\App\AuthAttempt
::
recordAuthAttempt
(
$user
,
"10.0.0.2"
);
$this
->
assertNotEquals
(
$authAttempt
->
id
,
$authAttempt3
->
id
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jul 8, 11:30 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1052241
Default Alt Text
AuthAttemptTest.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment