Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120823456
UnsuspendTest.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
UnsuspendTest.php
View Options
<?php
namespace
Tests\Feature\Console\User
;
use
Illuminate\Support\Facades\Queue
;
use
Tests\TestCase
;
class
UnsuspendTest
extends
TestCase
{
/**
* {@inheritDoc}
*/
public
function
setUp
():
void
{
parent
::
setUp
();
$this
->
deleteTestUser
(
'user@force-delete.com'
);
}
/**
* {@inheritDoc}
*/
public
function
tearDown
():
void
{
$this
->
deleteTestUser
(
'user@force-delete.com'
);
parent
::
tearDown
();
}
/**
* Test the command
*/
public
function
testHandle
():
void
{
Queue
::
fake
();
// Non-existing user
$code
=
\Artisan
::
call
(
"user:unsuspend unknown"
);
$output
=
trim
(
\Artisan
::
output
());
$this
->
assertSame
(
1
,
$code
);
$this
->
assertSame
(
"User not found."
,
$output
);
$user
=
$this
->
getTestUser
(
'user@force-delete.com'
);
$user
->
suspend
();
// Test success
$code
=
\Artisan
::
call
(
"user:unsuspend {$user->email}"
);
$output
=
trim
(
\Artisan
::
output
());
$this
->
assertSame
(
0
,
$code
);
$this
->
assertSame
(
""
,
$output
);
$this
->
assertFalse
(
$user
->
fresh
()->
isSuspended
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 10:06 AM (5 d, 2 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18830334
Default Alt Text
UnsuspendTest.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline