Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Console/Group/InfoTest.php
- This file was added.
<?php | |||||
namespace Tests\Feature\Console\Group; | |||||
use App\Group; | |||||
use Tests\TestCase; | |||||
class InfoTest extends TestCase | |||||
{ | |||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
public function setUp(): void | |||||
{ | |||||
parent::setUp(); | |||||
$this->deleteTestGroup('group-test@kolabnow.com'); | |||||
} | |||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
public function tearDown(): void | |||||
{ | |||||
$this->deleteTestGroup('group-test@kolabnow.com'); | |||||
parent::tearDown(); | |||||
} | |||||
/** | |||||
* Test command runs | |||||
*/ | |||||
public function testHandle(): void | |||||
{ | |||||
// Non-existing group | |||||
$this->artisan("group:info unknown@unknown.org") | |||||
->assertExitCode(1) | |||||
->expectsOutput("Group unknown@unknown.org does not exist."); | |||||
$group = $this->getTestGroup('group-test@kolabnow.com'); | |||||
// A group with no members | |||||
$this->artisan("group:info {$group->email}") | |||||
->assertExitCode(0); | |||||
// TODO: Test output | |||||
// $expected = "Id: {$group->id}\nEmail: {$group->email}\nStatus: {$group->status}\n"; | |||||
} | |||||
} |