Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Jobs/UserVerifyTest.php
Show All 35 Lines | class UserVerifyTest extends TestCase | ||||
* Test job handle | * Test job handle | ||||
* | * | ||||
* @group imap | * @group imap | ||||
*/ | */ | ||||
public function testHandle(): void | public function testHandle(): void | ||||
{ | { | ||||
Queue::fake(); | Queue::fake(); | ||||
// Test non-existing user ID | |||||
$job = new \App\Jobs\User\VerifyJob(123); | |||||
$job->handle(); | |||||
$this->assertTrue($job->hasFailed()); | |||||
$this->assertSame("User 123 could not be found in the database.", $job->failureMessage); | |||||
// Test existing user | |||||
$user = $this->getTestUser('ned@kolab.org'); | $user = $this->getTestUser('ned@kolab.org'); | ||||
if ($user->isImapReady()) { | if ($user->isImapReady()) { | ||||
$user->status ^= User::STATUS_IMAP_READY; | $user->status ^= User::STATUS_IMAP_READY; | ||||
$user->save(); | $user->save(); | ||||
} | } | ||||
$this->assertFalse($user->isImapReady()); | $this->assertFalse($user->isImapReady()); | ||||
Show All 16 Lines |