Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120835666
DeleteTest.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
DeleteTest.php
View Options
<?php
namespace
Tests\Feature\Console\Group
;
use
App\Group
;
use
Illuminate\Support\Facades\Queue
;
use
Tests\TestCase
;
class
DeleteTest
extends
TestCase
{
protected
function
setUp
():
void
{
parent
::
setUp
();
$this
->
deleteTestGroup
(
'group-test@kolabnow.com'
);
$this
->
deleteTestUser
(
'group-owner@kolabnow.com'
);
}
protected
function
tearDown
():
void
{
$this
->
deleteTestGroup
(
'group-test@kolabnow.com'
);
$this
->
deleteTestUser
(
'group-owner@kolabnow.com'
);
parent
::
tearDown
();
}
/**
* Test command runs
*/
public
function
testHandle
():
void
{
Queue
::
fake
();
// Warning: We're not using artisan() here, as this will not
// allow us to test "empty output" cases
// Non-existing group
$code
=
\Artisan
::
call
(
"group:delete test@group.com"
);
$output
=
trim
(
\Artisan
::
output
());
$this
->
assertSame
(
1
,
$code
);
$this
->
assertSame
(
"Group test@group.com does not exist."
,
$output
);
$user
=
$this
->
getTestUser
(
'group-owner@kolabnow.com'
);
$group
=
$this
->
getTestGroup
(
'group-test@kolabnow.com'
);
// Existing group
$code
=
\Artisan
::
call
(
"group:delete {$group->email}"
);
$output
=
trim
(
\Artisan
::
output
());
$this
->
assertSame
(
0
,
$code
);
$this
->
assertSame
(
''
,
$output
);
$this
->
assertTrue
(
$group
->
refresh
()->
trashed
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 1:20 PM (1 d, 16 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7e/6f/e50b4ef92200ef87a54d880beea7
Default Alt Text
DeleteTest.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline