Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/UserTest.php
Show All 29 Lines | public function testUserCreateJob(): void | ||||
Queue::assertPushed(\App\Jobs\ProcessUserCreate::class, 1); | Queue::assertPushed(\App\Jobs\ProcessUserCreate::class, 1); | ||||
Queue::assertPushed(\App\Jobs\ProcessUserCreate::class, function ($job) use ($user) { | Queue::assertPushed(\App\Jobs\ProcessUserCreate::class, function ($job) use ($user) { | ||||
$job_user = TestCase::getObjectProperty($job, 'user'); | $job_user = TestCase::getObjectProperty($job, 'user'); | ||||
return $job_user->id === $user->id | return $job_user->id === $user->id | ||||
&& $job_user->email === $user->email; | && $job_user->email === $user->email; | ||||
}); | }); | ||||
Queue::assertPushedWithChain(\App\Jobs\ProcessUserCreate::class, [ | |||||
\App\Jobs\ProcessUserVerify::class, | |||||
]); | |||||
/* | |||||
FIXME: Looks like we can't really do detailed assertions on chained jobs | |||||
Another thing to consider is if we maybe should run these jobs | |||||
independently (not chained) and make sure there's no race-condition | |||||
in status update | |||||
Queue::assertPushed(\App\Jobs\ProcessUserVerify::class, 1); | |||||
Queue::assertPushed(\App\Jobs\ProcessUserVerify::class, function ($job) use ($user) { | |||||
$job_user = TestCase::getObjectProperty($job, 'user'); | |||||
return $job_user->id === $user->id | |||||
&& $job_user->email === $user->email; | |||||
}); | |||||
*/ | |||||
} | } | ||||
/** | /** | ||||
* Verify a wallet assigned a controller is among the accounts of the assignee. | * Verify a wallet assigned a controller is among the accounts of the assignee. | ||||
*/ | */ | ||||
public function testListUserAccounts(): void | public function testListUserAccounts(): void | ||||
{ | { | ||||
$userA = $this->getTestUser('UserAccountA@UserAccount.com'); | $userA = $this->getTestUser('UserAccountA@UserAccount.com'); | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |