Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2397592
AuthAttemptTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
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
Mon, Nov 3, 2:21 PM (3 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
357746
Default Alt Text
AuthAttemptTest.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment