Page MenuHomePhorge

D5106.1775298590.diff
No OneTemporary

Authored By
Unknown
Size
50 KB
Referenced Files
None
Subscribers
None

D5106.1775298590.diff

diff --git a/src/app/Console/Commands/PasswordRetentionCommand.php b/src/app/Console/Commands/PasswordRetentionCommand.php
--- a/src/app/Console/Commands/PasswordRetentionCommand.php
+++ b/src/app/Console/Commands/PasswordRetentionCommand.php
@@ -77,7 +77,7 @@
// Send a warning if it wasn't sent yet or 7 days passed since the last warning.
// Which means that we send the email 14 and 7 days before the password expires.
if (empty($warnedOn) || $warnedOn->diffInDays(Carbon::now(), false) > 7) {
- \App\Jobs\Password\RetentionEmailJob::dispatch($user, $nextUpdate->toDateString());
+ \App\Jobs\Mail\PasswordRetentionJob::dispatch($user, $nextUpdate->toDateString());
}
}
});
diff --git a/src/app/Console/Commands/Wallet/TrialEndCommand.php b/src/app/Console/Commands/Wallet/TrialEndCommand.php
--- a/src/app/Console/Commands/Wallet/TrialEndCommand.php
+++ b/src/app/Console/Commands/Wallet/TrialEndCommand.php
@@ -60,7 +60,7 @@
}
// Send the email asynchronously
- \App\Jobs\TrialEndEmail::dispatch($wallet->owner);
+ \App\Jobs\Mail\TrialEndJob::dispatch($wallet->owner);
// Store the timestamp
$wallet->setSetting('trial_end_notice', (string) \now());
diff --git a/src/app/Http/Controllers/API/PasswordResetController.php b/src/app/Http/Controllers/API/PasswordResetController.php
--- a/src/app/Http/Controllers/API/PasswordResetController.php
+++ b/src/app/Http/Controllers/API/PasswordResetController.php
@@ -3,7 +3,7 @@
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
-use App\Jobs\PasswordResetEmail;
+use App\Jobs\Mail\PasswordResetJob;
use App\Rules\Password;
use App\User;
use App\VerificationCode;
@@ -59,7 +59,7 @@
$user->verificationcodes()->save($code);
// Send email/sms message
- PasswordResetEmail::dispatch($code);
+ PasswordResetJob::dispatch($code);
return response()->json(['status' => 'success', 'code' => $code->code]);
}
diff --git a/src/app/Http/Controllers/API/SignupController.php b/src/app/Http/Controllers/API/SignupController.php
--- a/src/app/Http/Controllers/API/SignupController.php
+++ b/src/app/Http/Controllers/API/SignupController.php
@@ -3,7 +3,7 @@
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
-use App\Jobs\SignupVerificationEmail;
+use App\Jobs\Mail\SignupVerificationJob;
use App\Discount;
use App\Domain;
use App\Plan;
@@ -135,7 +135,7 @@
$response['domains'] = $has_domain ? [] : Domain::getPublicDomains();
} else {
// External email verification, send an email message
- SignupVerificationEmail::dispatch($code);
+ SignupVerificationJob::dispatch($code);
}
return response()->json($response);
diff --git a/src/app/Http/Controllers/API/V4/PaymentsController.php b/src/app/Http/Controllers/API/V4/PaymentsController.php
--- a/src/app/Http/Controllers/API/V4/PaymentsController.php
+++ b/src/app/Http/Controllers/API/V4/PaymentsController.php
@@ -406,7 +406,7 @@
// Disable (not remove) the mandate
\Log::warning("Top-up for wallet {$wallet->id}: mandate too little");
$wallet->setSetting('mandate_disabled', '1');
- \App\Jobs\PaymentMandateDisabledEmail::dispatch($wallet);
+ \App\Jobs\Mail\PaymentMandateDisabledJob::dispatch($wallet);
return false;
}
diff --git a/src/app/Jobs/PasswordResetEmail.php b/src/app/Jobs/Mail/PasswordResetJob.php
rename from src/app/Jobs/PasswordResetEmail.php
rename to src/app/Jobs/Mail/PasswordResetJob.php
--- a/src/app/Jobs/PasswordResetEmail.php
+++ b/src/app/Jobs/Mail/PasswordResetJob.php
@@ -1,34 +1,16 @@
<?php
-namespace App\Jobs;
+namespace App\Jobs\Mail;
use App\Mail\PasswordReset;
use App\VerificationCode;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-class PasswordResetEmail implements ShouldQueue
+class PasswordResetJob extends \App\Jobs\MailJob
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
- /** @var int The number of seconds to wait before retrying the job. */
- public $backoff = 10;
-
- /** @var bool Delete the job if its models no longer exist. */
- public $deleteWhenMissingModels = true;
-
/** @var \App\VerificationCode Verification code object */
protected $code;
+
/**
* Create a new job instance.
*
@@ -39,6 +21,7 @@
public function __construct(VerificationCode $code)
{
$this->code = $code;
+ $this->onQueue(self::QUEUE);
}
/**
diff --git a/src/app/Jobs/Password/RetentionEmailJob.php b/src/app/Jobs/Mail/PasswordRetentionJob.php
rename from src/app/Jobs/Password/RetentionEmailJob.php
rename to src/app/Jobs/Mail/PasswordRetentionJob.php
--- a/src/app/Jobs/Password/RetentionEmailJob.php
+++ b/src/app/Jobs/Mail/PasswordRetentionJob.php
@@ -1,27 +1,11 @@
<?php
-namespace App\Jobs\Password;
+namespace App\Jobs\Mail;
use App\Mail\PasswordExpirationReminder;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-class RetentionEmailJob implements ShouldQueue
+class PasswordRetentionJob extends \App\Jobs\MailJob
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var bool Delete the job if its models no longer exist. */
- public $deleteWhenMissingModels = true;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
/** @var int The number of seconds to wait before retrying the job. */
public $backoff = 30;
@@ -44,6 +28,7 @@
{
$this->user = $user;
$this->expiresOn = $expiresOn;
+ $this->onQueue(self::QUEUE);
}
/**
diff --git a/src/app/Jobs/PaymentEmail.php b/src/app/Jobs/Mail/PaymentJob.php
rename from src/app/Jobs/PaymentEmail.php
rename to src/app/Jobs/Mail/PaymentJob.php
--- a/src/app/Jobs/PaymentEmail.php
+++ b/src/app/Jobs/Mail/PaymentJob.php
@@ -1,31 +1,15 @@
<?php
-namespace App\Jobs;
+namespace App\Jobs\Mail;
use App\Payment;
use App\User;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-class PaymentEmail implements ShouldQueue
+class PaymentJob extends \App\Jobs\MailJob
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
/** @var int The number of seconds to wait before retrying the job. */
public $backoff = 30;
- /** @var bool Delete the job if the wallet no longer exist. */
- public $deleteWhenMissingModels = true;
-
/** @var \App\Payment A payment object */
protected $payment;
@@ -45,6 +29,7 @@
{
$this->payment = $payment;
$this->controller = $controller;
+ $this->onQueue(self::QUEUE);
}
/**
diff --git a/src/app/Jobs/PaymentMandateDisabledEmail.php b/src/app/Jobs/Mail/PaymentMandateDisabledJob.php
rename from src/app/Jobs/PaymentMandateDisabledEmail.php
rename to src/app/Jobs/Mail/PaymentMandateDisabledJob.php
--- a/src/app/Jobs/PaymentMandateDisabledEmail.php
+++ b/src/app/Jobs/Mail/PaymentMandateDisabledJob.php
@@ -1,32 +1,16 @@
<?php
-namespace App\Jobs;
+namespace App\Jobs\Mail;
use App\Mail\PaymentMandateDisabled;
use App\User;
use App\Wallet;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-class PaymentMandateDisabledEmail implements ShouldQueue
+class PaymentMandateDisabledJob extends \App\Jobs\MailJob
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
/** @var int The number of seconds to wait before retrying the job. */
public $backoff = 30;
- /** @var bool Delete the job if the wallet no longer exist. */
- public $deleteWhenMissingModels = true;
-
/** @var \App\Wallet A wallet object */
protected $wallet;
@@ -46,6 +30,7 @@
{
$this->wallet = $wallet;
$this->controller = $controller;
+ $this->onQueue(self::QUEUE);
}
/**
diff --git a/src/app/Jobs/SignupInvitationEmail.php b/src/app/Jobs/Mail/SignupInvitationJob.php
rename from src/app/Jobs/SignupInvitationEmail.php
rename to src/app/Jobs/Mail/SignupInvitationJob.php
--- a/src/app/Jobs/SignupInvitationEmail.php
+++ b/src/app/Jobs/Mail/SignupInvitationJob.php
@@ -1,31 +1,12 @@
<?php
-namespace App\Jobs;
+namespace App\Jobs\Mail;
-use App\SignupInvitation;
use App\Mail\SignupInvitation as SignupInvitationMail;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
+use App\SignupInvitation;
-class SignupInvitationEmail implements ShouldQueue
+class SignupInvitationJob extends \App\Jobs\MailJob
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
- /** @var bool Delete the job if its models no longer exist. */
- public $deleteWhenMissingModels = true;
-
- /** @var int The number of seconds to wait before retrying the job. */
- public $backoff = 10;
-
/** @var SignupInvitation Signup invitation object */
protected $invitation;
@@ -40,6 +21,7 @@
public function __construct(SignupInvitation $invitation)
{
$this->invitation = $invitation;
+ $this->onQueue(self::QUEUE);
}
/**
diff --git a/src/app/Jobs/Mail/SignupVerificationJob.php b/src/app/Jobs/Mail/SignupVerificationJob.php
new file mode 100644
--- /dev/null
+++ b/src/app/Jobs/Mail/SignupVerificationJob.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace App\Jobs\Mail;
+
+use App\Mail\SignupVerification;
+use App\SignupCode;
+
+class SignupVerificationJob extends \App\Jobs\MailJob
+{
+ /** @var SignupCode Signup verification code object */
+ protected $code;
+
+
+ /**
+ * Create a new job instance.
+ *
+ * @param SignupCode $code Verification code object
+ *
+ * @return void
+ */
+ public function __construct(SignupCode $code)
+ {
+ $this->code = $code;
+ $this->onQueue(self::QUEUE);
+ }
+
+ /**
+ * Execute the job.
+ *
+ * @return void
+ */
+ public function handle()
+ {
+ \App\Mail\Helper::sendMail(
+ new SignupVerification($this->code),
+ $this->code->tenant_id,
+ ['to' => $this->code->email]
+ );
+ }
+}
diff --git a/src/app/Jobs/TrialEndEmail.php b/src/app/Jobs/Mail/TrialEndJob.php
rename from src/app/Jobs/TrialEndEmail.php
rename to src/app/Jobs/Mail/TrialEndJob.php
--- a/src/app/Jobs/TrialEndEmail.php
+++ b/src/app/Jobs/Mail/TrialEndJob.php
@@ -1,34 +1,19 @@
<?php
-namespace App\Jobs;
+namespace App\Jobs\Mail;
use App\Mail\TrialEnd;
use App\User;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-class TrialEndEmail implements ShouldQueue
+class TrialEndJob extends \App\Jobs\MailJob
{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
/** @var int The number of seconds to wait before retrying the job. */
public $backoff = 30;
- /** @var bool Delete the job if its models no longer exist. */
- public $deleteWhenMissingModels = true;
-
/** @var \App\User The account owner */
protected $account;
+
/**
* Create a new job instance.
*
@@ -39,6 +24,7 @@
public function __construct(User $account)
{
$this->account = $account;
+ $this->onQueue(self::QUEUE);
}
/**
diff --git a/src/app/Jobs/SignupVerificationEmail.php b/src/app/Jobs/SignupVerificationEmail.php
deleted file mode 100644
--- a/src/app/Jobs/SignupVerificationEmail.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-namespace App\Jobs;
-
-use App\Mail\SignupVerification;
-use App\SignupCode;
-use Illuminate\Bus\Queueable;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-
-class SignupVerificationEmail implements ShouldQueue
-{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
- /** @var int The number of seconds to wait before retrying the job. */
- public $backoff = 10;
-
- /** @var bool Delete the job if its models no longer exist. */
- public $deleteWhenMissingModels = true;
-
- /** @var SignupCode Signup verification code object */
- protected $code;
-
-
- /**
- * Create a new job instance.
- *
- * @param SignupCode $code Verification code object
- *
- * @return void
- */
- public function __construct(SignupCode $code)
- {
- $this->code = $code;
- }
-
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- \App\Mail\Helper::sendMail(
- new SignupVerification($this->code),
- $this->code->tenant_id,
- ['to' => $this->code->email]
- );
- }
-}
diff --git a/src/app/Jobs/SignupVerificationSMS.php b/src/app/Jobs/SignupVerificationSMS.php
deleted file mode 100644
--- a/src/app/Jobs/SignupVerificationSMS.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-namespace App\Jobs;
-
-use App\SignupCode;
-use Illuminate\Bus\Queueable;
-use Illuminate\Queue\SerializesModels;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Contracts\Queue\ShouldQueue;
-use Illuminate\Foundation\Bus\Dispatchable;
-
-class SignupVerificationSMS implements ShouldQueue
-{
- use Dispatchable;
- use InteractsWithQueue;
- use Queueable;
- use SerializesModels;
-
- /** @var int The number of times the job may be attempted. */
- public $tries = 3;
-
- /** @var int The number of seconds to wait before retrying the job. */
- public $backoff = 10;
-
- /** @var bool Delete the job if its models no longer exist. */
- public $deleteWhenMissingModels = true;
-
- /** @var SignupCode Signup verification code object */
- protected $code;
-
-
- /**
- * Create a new job instance.
- *
- * @param SignupCode $code Verification code object
- *
- * @return void
- */
- public function __construct(SignupCode $code)
- {
- $this->code = $code;
- }
-
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- // TODO
- }
-}
diff --git a/src/app/Observers/SignupInvitationObserver.php b/src/app/Observers/SignupInvitationObserver.php
--- a/src/app/Observers/SignupInvitationObserver.php
+++ b/src/app/Observers/SignupInvitationObserver.php
@@ -30,7 +30,7 @@
*/
public function created(SI $invitation)
{
- \App\Jobs\SignupInvitationEmail::dispatch($invitation);
+ \App\Jobs\Mail\SignupInvitationJob::dispatch($invitation);
}
/**
@@ -49,7 +49,7 @@
$invitation->status == SI::STATUS_NEW
&& ($oldStatus == SI::STATUS_FAILED || $oldStatus == SI::STATUS_SENT)
) {
- \App\Jobs\SignupInvitationEmail::dispatch($invitation);
+ \App\Jobs\Mail\SignupInvitationJob::dispatch($invitation);
}
}
}
diff --git a/src/app/Providers/Payment/Mollie.php b/src/app/Providers/Payment/Mollie.php
--- a/src/app/Providers/Payment/Mollie.php
+++ b/src/app/Providers/Payment/Mollie.php
@@ -339,7 +339,7 @@
DB::commit();
if (!empty($notify)) {
- \App\Jobs\PaymentEmail::dispatch($payment);
+ \App\Jobs\Mail\PaymentJob::dispatch($payment);
}
return [
@@ -456,7 +456,7 @@
DB::commit();
if (!empty($notify)) {
- \App\Jobs\PaymentEmail::dispatch($payment);
+ \App\Jobs\Mail\PaymentJob::dispatch($payment);
}
} catch (ApiException $e) {
\Log::error(sprintf('Mollie API call failed (%s)', $e->getMessage()));
diff --git a/src/app/Providers/Payment/Stripe.php b/src/app/Providers/Payment/Stripe.php
--- a/src/app/Providers/Payment/Stripe.php
+++ b/src/app/Providers/Payment/Stripe.php
@@ -337,7 +337,7 @@
}
// Notify the user
- \App\Jobs\PaymentEmail::dispatch($payment);
+ \App\Jobs\Mail\PaymentJob::dispatch($payment);
}
}
diff --git a/src/tests/Feature/Console/PasswordRetentionTest.php b/src/tests/Feature/Console/PasswordRetentionTest.php
--- a/src/tests/Feature/Console/PasswordRetentionTest.php
+++ b/src/tests/Feature/Console/PasswordRetentionTest.php
@@ -2,7 +2,8 @@
namespace Tests\Feature\Console;
-use App\Jobs\Password\RetentionEmailJob;
+use App\Jobs\MailJob;
+use App\Jobs\Mail\PasswordRetentionJob;
use App\User;
use Illuminate\Support\Facades\Queue;
use Tests\TestCase;
@@ -89,12 +90,12 @@
$this->assertSame(0, $code);
$this->assertSame("", $output);
- Queue::assertPushed(RetentionEmailJob::class, 2);
- Queue::assertPushed(RetentionEmailJob::class, function ($job) use ($user) {
+ Queue::assertPushed(PasswordRetentionJob::class, 2);
+ Queue::assertPushed(PasswordRetentionJob::class, function ($job) use ($user) {
$job_user = TestCase::getObjectProperty($job, 'user');
return $job_user->id === $user->id;
});
- Queue::assertPushed(RetentionEmailJob::class, function ($job) use ($owner) {
+ Queue::assertPushed(PasswordRetentionJob::class, function ($job) use ($owner) {
$job_user = TestCase::getObjectProperty($job, 'user');
return $job_user->id === $owner->id;
});
@@ -108,8 +109,8 @@
$code = \Artisan::call("password:retention");
$this->assertSame(0, $code);
- Queue::assertPushed(RetentionEmailJob::class, 1);
- Queue::assertPushed(RetentionEmailJob::class, function ($job) use ($user) {
+ Queue::assertPushed(PasswordRetentionJob::class, 1);
+ Queue::assertPushed(PasswordRetentionJob::class, function ($job) use ($user) {
$job_user = TestCase::getObjectProperty($job, 'user');
return $job_user->id === $user->id;
});
diff --git a/src/tests/Feature/Console/Wallet/TrialEndTest.php b/src/tests/Feature/Console/Wallet/TrialEndTest.php
--- a/src/tests/Feature/Console/Wallet/TrialEndTest.php
+++ b/src/tests/Feature/Console/Wallet/TrialEndTest.php
@@ -66,8 +66,8 @@
Queue::fake();
$code = \Artisan::call("wallet:trial-end");
- Queue::assertPushed(\App\Jobs\TrialEndEmail::class, 1);
- Queue::assertPushed(\App\Jobs\TrialEndEmail::class, function ($job) use ($user) {
+ Queue::assertPushed(\App\Jobs\Mail\TrialEndJob::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\TrialEndJob::class, function ($job) use ($user) {
$job_user = TestCase::getObjectProperty($job, 'account');
return $job_user->id === $user->id;
});
diff --git a/src/tests/Feature/Controller/PasswordResetTest.php b/src/tests/Feature/Controller/PasswordResetTest.php
--- a/src/tests/Feature/Controller/PasswordResetTest.php
+++ b/src/tests/Feature/Controller/PasswordResetTest.php
@@ -120,10 +120,10 @@
$this->assertNotEmpty($json['code']);
// Assert the email sending job was pushed once
- Queue::assertPushed(\App\Jobs\PasswordResetEmail::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\PasswordResetJob::class, 1);
// Assert the job has proper data assigned
- Queue::assertPushed(\App\Jobs\PasswordResetEmail::class, function ($job) use ($user, &$code, $json) {
+ Queue::assertPushed(\App\Jobs\Mail\PasswordResetJob::class, function ($job) use ($user, &$code, $json) {
$code = TestCase::getObjectProperty($job, 'code');
return $code->user->id == $user->id && $code->code == $json['code'];
diff --git a/src/tests/Feature/Controller/PaymentsCoinbaseTest.php b/src/tests/Feature/Controller/PaymentsCoinbaseTest.php
--- a/src/tests/Feature/Controller/PaymentsCoinbaseTest.php
+++ b/src/tests/Feature/Controller/PaymentsCoinbaseTest.php
@@ -195,7 +195,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
// Verify "paid -> open -> paid" scenario, assert that balance didn't change
$post = [
@@ -258,7 +258,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
}
/**
diff --git a/src/tests/Feature/Controller/PaymentsMollieEuroTest.php b/src/tests/Feature/Controller/PaymentsMollieEuroTest.php
--- a/src/tests/Feature/Controller/PaymentsMollieEuroTest.php
+++ b/src/tests/Feature/Controller/PaymentsMollieEuroTest.php
@@ -381,7 +381,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
// Verify "paid -> open -> paid" scenario, assert that balance didn't change
$mollie_response['status'] = 'open';
@@ -432,7 +432,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
}
/**
@@ -486,8 +486,8 @@
$transaction->description
);
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -514,8 +514,8 @@
$this->assertFalse($result);
$this->assertCount(2, $wallet->payments()->get());
- Bus::assertDispatchedTimes(\App\Jobs\PaymentMandateDisabledEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentMandateDisabledEmail::class, function ($job) use ($wallet) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentMandateDisabledJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentMandateDisabledJob::class, function ($job) use ($wallet) {
$job_wallet = $this->getObjectProperty($job, 'wallet');
return $job_wallet->id === $wallet->id;
});
@@ -528,7 +528,7 @@
$this->assertFalse($result);
$this->assertCount(2, $wallet->payments()->get());
- Bus::assertDispatchedTimes(\App\Jobs\PaymentMandateDisabledEmail::class, 1);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentMandateDisabledJob::class, 1);
// Test webhook for recurring payments
@@ -572,8 +572,8 @@
);
// Assert that email notification job has been dispatched
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -607,8 +607,8 @@
$this->assertTrue(!empty($wallet->getSetting('mandate_disabled')));
// Assert that email notification job has been dispatched
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -772,7 +772,7 @@
$this->assertSame("mollie", $payments[0]->provider);
$this->assertSame('', $payments[0]->description);
- Bus::assertNotDispatched(\App\Jobs\PaymentEmail::class);
+ Bus::assertNotDispatched(\App\Jobs\Mail\PaymentJob::class);
$this->unmockMollie();
}
diff --git a/src/tests/Feature/Controller/PaymentsMollieTest.php b/src/tests/Feature/Controller/PaymentsMollieTest.php
--- a/src/tests/Feature/Controller/PaymentsMollieTest.php
+++ b/src/tests/Feature/Controller/PaymentsMollieTest.php
@@ -460,7 +460,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
// Verify "paid -> open -> paid" scenario, assert that balance didn't change
$mollie_response['status'] = 'open';
@@ -511,7 +511,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
}
/**
@@ -607,8 +607,8 @@
$transaction->description
);
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -635,8 +635,8 @@
$this->assertFalse($result);
$this->assertCount(2, $wallet->payments()->get());
- Bus::assertDispatchedTimes(\App\Jobs\PaymentMandateDisabledEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentMandateDisabledEmail::class, function ($job) use ($wallet) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentMandateDisabledJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentMandateDisabledJob::class, function ($job) use ($wallet) {
$job_wallet = $this->getObjectProperty($job, 'wallet');
return $job_wallet->id === $wallet->id;
});
@@ -649,7 +649,7 @@
$this->assertFalse($result);
$this->assertCount(2, $wallet->payments()->get());
- Bus::assertDispatchedTimes(\App\Jobs\PaymentMandateDisabledEmail::class, 1);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentMandateDisabledJob::class, 1);
// Test webhook for recurring payments
@@ -693,8 +693,8 @@
);
// Assert that email notification job has been dispatched
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -728,8 +728,8 @@
$this->assertTrue(!empty($wallet->getSetting('mandate_disabled')));
// Assert that email notification job has been dispatched
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -956,7 +956,7 @@
$this->assertSame("mollie", $payments[0]->provider);
$this->assertSame('', $payments[0]->description);
- Bus::assertNotDispatched(\App\Jobs\PaymentEmail::class);
+ Bus::assertNotDispatched(\App\Jobs\Mail\PaymentJob::class);
$this->unmockMollie();
}
diff --git a/src/tests/Feature/Controller/PaymentsStripeTest.php b/src/tests/Feature/Controller/PaymentsStripeTest.php
--- a/src/tests/Feature/Controller/PaymentsStripeTest.php
+++ b/src/tests/Feature/Controller/PaymentsStripeTest.php
@@ -417,7 +417,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
// Test that balance didn't change if the same event is posted
$response = $this->webhookRequest($post);
@@ -442,7 +442,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
// Test for payment failure ('canceled' status)
$payment->refresh();
@@ -460,7 +460,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
}
/**
@@ -622,8 +622,8 @@
$this->assertFalse($result);
$this->assertCount(1, $wallet->payments()->get());
- Bus::assertDispatchedTimes(\App\Jobs\PaymentMandateDisabledEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentMandateDisabledEmail::class, function ($job) use ($wallet) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentMandateDisabledJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentMandateDisabledJob::class, function ($job) use ($wallet) {
$job_wallet = $this->getObjectProperty($job, 'wallet');
return $job_wallet->id === $wallet->id;
});
@@ -636,7 +636,7 @@
$this->assertFalse($result);
$this->assertCount(1, $wallet->payments()->get());
- Bus::assertDispatchedTimes(\App\Jobs\PaymentMandateDisabledEmail::class, 1);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentMandateDisabledJob::class, 1);
$this->unmockStripe();
@@ -681,8 +681,8 @@
);
// Assert that email notification job has been dispatched
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -709,8 +709,8 @@
$this->assertTrue(!empty($wallet->getSetting('mandate_disabled')));
// Assert that email notification job has been dispatched
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 1);
- Bus::assertDispatched(\App\Jobs\PaymentEmail::class, function ($job) use ($payment) {
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 1);
+ Bus::assertDispatched(\App\Jobs\Mail\PaymentJob::class, function ($job) use ($payment) {
$job_payment = $this->getObjectProperty($job, 'payment');
return $job_payment->id === $payment->id;
});
@@ -733,7 +733,7 @@
// Assert that email notification job wasn't dispatched,
// it is expected only for recurring payments
- Bus::assertDispatchedTimes(\App\Jobs\PaymentEmail::class, 0);
+ Bus::assertDispatchedTimes(\App\Jobs\Mail\PaymentJob::class, 0);
}
/**
diff --git a/src/tests/Feature/Controller/SignupTest.php b/src/tests/Feature/Controller/SignupTest.php
--- a/src/tests/Feature/Controller/SignupTest.php
+++ b/src/tests/Feature/Controller/SignupTest.php
@@ -346,10 +346,10 @@
$this->assertSame(null, $code->submit_ip_address);
// Assert the email sending job was pushed once
- Queue::assertPushed(\App\Jobs\SignupVerificationEmail::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\SignupVerificationJob::class, 1);
// Assert the job has proper data assigned
- Queue::assertPushed(\App\Jobs\SignupVerificationEmail::class, function ($job) use ($data, $json) {
+ Queue::assertPushed(\App\Jobs\Mail\SignupVerificationJob::class, function ($job) use ($data, $json) {
$code = TestCase::getObjectProperty($job, 'code');
return $code->code === $json['code']
@@ -372,7 +372,7 @@
$this->assertNotEmpty($json['code']);
// Assert the job has proper data assigned
- Queue::assertPushed(\App\Jobs\SignupVerificationEmail::class, function ($job) use ($data, $json) {
+ Queue::assertPushed(\App\Jobs\Mail\SignupVerificationJob::class, function ($job) use ($data, $json) {
$code = TestCase::getObjectProperty($job, 'code');
return $code->code === $json['code']
@@ -725,10 +725,10 @@
$this->assertNotEmpty($json['code']);
// Assert the email sending job was pushed once
- Queue::assertPushed(\App\Jobs\SignupVerificationEmail::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\SignupVerificationJob::class, 1);
// Assert the job has proper data assigned
- Queue::assertPushed(\App\Jobs\SignupVerificationEmail::class, function ($job) use ($data, $json) {
+ Queue::assertPushed(\App\Jobs\Mail\SignupVerificationJob::class, function ($job) use ($data, $json) {
$code = TestCase::getObjectProperty($job, 'code');
return $code->code === $json['code']
diff --git a/src/tests/Feature/Jobs/PasswordResetEmailTest.php b/src/tests/Feature/Jobs/Mail/PasswordResetJobTest.php
rename from src/tests/Feature/Jobs/PasswordResetEmailTest.php
rename to src/tests/Feature/Jobs/Mail/PasswordResetJobTest.php
--- a/src/tests/Feature/Jobs/PasswordResetEmailTest.php
+++ b/src/tests/Feature/Jobs/Mail/PasswordResetJobTest.php
@@ -1,20 +1,18 @@
<?php
-namespace Tests\Feature\Jobs;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\PasswordResetEmail;
+use App\Jobs\Mail\PasswordResetJob;
use App\Mail\PasswordReset;
use App\User;
use App\VerificationCode;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
-class PasswordResetEmailTest extends TestCase
+class PasswordResetJobTest extends TestCase
{
/**
* {@inheritDoc}
- *
- * @return void
*/
public function setUp(): void
{
@@ -25,8 +23,6 @@
/**
* {@inheritDoc}
- *
- * @return void
*/
public function tearDown(): void
{
@@ -37,10 +33,8 @@
/**
* Test job handle
- *
- * @return void
*/
- public function testPasswordResetEmailHandle()
+ public function testHandle(): void
{
$code = new VerificationCode([
'mode' => 'password-reset',
@@ -55,9 +49,11 @@
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new PasswordResetEmail($code);
+ $job = new PasswordResetJob($code);
$job->handle();
+ $this->assertSame(PasswordResetJob::QUEUE, $job->queue);
+
// Assert the email sending job was pushed once
Mail::assertSent(PasswordReset::class, 1);
diff --git a/src/tests/Feature/Jobs/Password/RetentionEmailJobTest.php b/src/tests/Feature/Jobs/Mail/PasswordRetentionJobTest.php
rename from src/tests/Feature/Jobs/Password/RetentionEmailJobTest.php
rename to src/tests/Feature/Jobs/Mail/PasswordRetentionJobTest.php
--- a/src/tests/Feature/Jobs/Password/RetentionEmailJobTest.php
+++ b/src/tests/Feature/Jobs/Mail/PasswordRetentionJobTest.php
@@ -1,19 +1,17 @@
<?php
-namespace Tests\Feature\Jobs\Password;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\Password\RetentionEmailJob;
+use App\Jobs\Mail\PasswordRetentionJob;
use App\Mail\PasswordExpirationReminder;
use App\User;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
-class RetentionEmailJobTest extends TestCase
+class PasswordRetentionJobTest extends TestCase
{
/**
* {@inheritDoc}
- *
- * @return void
*/
public function setUp(): void
{
@@ -24,8 +22,6 @@
/**
* {@inheritDoc}
- *
- * @return void
*/
public function tearDown(): void
{
@@ -36,10 +32,8 @@
/**
* Test job handle
- *
- * @return void
*/
- public function testHandle()
+ public function testHandle(): void
{
$status = User::STATUS_ACTIVE | User::STATUS_LDAP_READY | User::STATUS_IMAP_READY;
$user = $this->getTestUser('PasswordRetention@UserAccount.com', ['status' => $status]);
@@ -50,9 +44,10 @@
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new RetentionEmailJob($user, $expiresOn);
+ $job = new PasswordRetentionJob($user, $expiresOn);
$job->handle();
+ $this->assertSame(PasswordRetentionJob::QUEUE, $job->queue);
$this->assertMatchesRegularExpression(
'/^' . now()->format('Y-m-d') . ' [0-9]{2}:[0-9]{2}:[0-9]{2}$/',
$user->getSetting('password_expiration_warning')
diff --git a/src/tests/Feature/Jobs/PaymentEmailTest.php b/src/tests/Feature/Jobs/Mail/PaymentJobTest.php
rename from src/tests/Feature/Jobs/PaymentEmailTest.php
rename to src/tests/Feature/Jobs/Mail/PaymentJobTest.php
--- a/src/tests/Feature/Jobs/PaymentEmailTest.php
+++ b/src/tests/Feature/Jobs/Mail/PaymentJobTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Tests\Feature\Jobs;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\PaymentEmail;
+use App\Jobs\Mail\PaymentJob;
use App\Mail\PaymentFailure;
use App\Mail\PaymentSuccess;
use App\Payment;
@@ -10,12 +10,10 @@
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
-class PaymentEmailTest extends TestCase
+class PaymentJobTest extends TestCase
{
/**
* {@inheritDoc}
- *
- * @return void
*/
public function setUp(): void
{
@@ -26,8 +24,6 @@
/**
* {@inheritDoc}
- *
- * @return void
*/
public function tearDown(): void
{
@@ -38,10 +34,8 @@
/**
* Test job handle
- *
- * @return void
*/
- public function testHandle()
+ public function testHandle(): void
{
$status = User::STATUS_ACTIVE | User::STATUS_LDAP_READY | User::STATUS_IMAP_READY;
$user = $this->getTestUser('PaymentEmail@UserAccount.com', ['status' => $status]);
@@ -66,9 +60,11 @@
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new PaymentEmail($payment);
+ $job = new PaymentJob($payment);
$job->handle();
+ $this->assertSame(PaymentJob::QUEUE, $job->queue);
+
// Assert the email sending job was pushed once
Mail::assertSent(PaymentSuccess::class, 1);
@@ -80,7 +76,7 @@
$payment->status = Payment::STATUS_FAILED;
$payment->save();
- $job = new PaymentEmail($payment);
+ $job = new PaymentJob($payment);
$job->handle();
// Assert the email sending job was pushed once
@@ -94,7 +90,7 @@
$payment->status = Payment::STATUS_EXPIRED;
$payment->save();
- $job = new PaymentEmail($payment);
+ $job = new PaymentJob($payment);
$job->handle();
// Assert the email sending job was pushed twice
@@ -114,7 +110,7 @@
$payment->status = $state;
$payment->save();
- $job = new PaymentEmail($payment);
+ $job = new PaymentJob($payment);
$job->handle();
}
diff --git a/src/tests/Feature/Jobs/PaymentMandateDisabledEmailTest.php b/src/tests/Feature/Jobs/Mail/PaymentMandateDisabledJobTest.php
rename from src/tests/Feature/Jobs/PaymentMandateDisabledEmailTest.php
rename to src/tests/Feature/Jobs/Mail/PaymentMandateDisabledJobTest.php
--- a/src/tests/Feature/Jobs/PaymentMandateDisabledEmailTest.php
+++ b/src/tests/Feature/Jobs/Mail/PaymentMandateDisabledJobTest.php
@@ -1,19 +1,17 @@
<?php
-namespace Tests\Feature\Jobs;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\PaymentMandateDisabledEmail;
+use App\Jobs\Mail\PaymentMandateDisabledJob;
use App\Mail\PaymentMandateDisabled;
use App\User;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
-class PaymentMandateDisabledEmailTest extends TestCase
+class PaymentMandateDisabledJobTest extends TestCase
{
/**
* {@inheritDoc}
- *
- * @return void
*/
public function setUp(): void
{
@@ -24,8 +22,6 @@
/**
* {@inheritDoc}
- *
- * @return void
*/
public function tearDown(): void
{
@@ -36,10 +32,8 @@
/**
* Test job handle
- *
- * @return void
*/
- public function testHandle()
+ public function testHandle(): void
{
$status = User::STATUS_ACTIVE | User::STATUS_LDAP_READY | User::STATUS_IMAP_READY;
$user = $this->getTestUser('PaymentEmail@UserAccount.com', ['status' => $status]);
@@ -51,9 +45,11 @@
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new PaymentMandateDisabledEmail($wallet);
+ $job = new PaymentMandateDisabledJob($wallet);
$job->handle();
+ $this->assertSame(PaymentMandateDisabledJob::QUEUE, $job->queue);
+
// Assert the email sending job was pushed once
Mail::assertSent(PaymentMandateDisabled::class, 1);
diff --git a/src/tests/Feature/Jobs/SignupInvitationEmailTest.php b/src/tests/Feature/Jobs/Mail/SignupInvitationJobTest.php
rename from src/tests/Feature/Jobs/SignupInvitationEmailTest.php
rename to src/tests/Feature/Jobs/Mail/SignupInvitationJobTest.php
--- a/src/tests/Feature/Jobs/SignupInvitationEmailTest.php
+++ b/src/tests/Feature/Jobs/Mail/SignupInvitationJobTest.php
@@ -1,8 +1,8 @@
<?php
-namespace Tests\Feature\Jobs;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\SignupInvitationEmail;
+use App\Jobs\Mail\SignupInvitationJob;
use App\Mail\SignupInvitation;
use App\SignupInvitation as SI;
use Illuminate\Queue\Events\JobFailed;
@@ -10,7 +10,7 @@
use Illuminate\Support\Facades\Queue;
use Tests\TestCase;
-class SignupInvitationEmailTest extends TestCase
+class SignupInvitationJobTest extends TestCase
{
private $invitation;
@@ -37,16 +37,18 @@
/**
* Test job handle
*/
- public function testSignupInvitationEmailHandle(): void
+ public function testHandle(): void
{
Mail::fake();
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new SignupInvitationEmail($this->invitation);
+ $job = new SignupInvitationJob($this->invitation);
$job->handle();
+ $this->assertSame(SignupInvitationJob::QUEUE, $job->queue);
+
// Assert the email sending job was pushed once
Mail::assertSent(SignupInvitation::class, 1);
@@ -61,7 +63,7 @@
/**
* Test job failure handling
*/
- public function testSignupInvitationEmailFailure(): void
+ public function testFailure(): void
{
$this->markTestIncomplete();
}
diff --git a/src/tests/Feature/Jobs/SignupVerificationEmailTest.php b/src/tests/Feature/Jobs/Mail/SignupVerificationJobTest.php
rename from src/tests/Feature/Jobs/SignupVerificationEmailTest.php
rename to src/tests/Feature/Jobs/Mail/SignupVerificationJobTest.php
--- a/src/tests/Feature/Jobs/SignupVerificationEmailTest.php
+++ b/src/tests/Feature/Jobs/Mail/SignupVerificationJobTest.php
@@ -1,20 +1,18 @@
<?php
-namespace Tests\Feature\Jobs;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\SignupVerificationEmail;
+use App\Jobs\Mail\SignupVerificationJob;
use App\Mail\SignupVerification;
use App\SignupCode;
use App\Tenant;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
-class SignupVerificationEmailTest extends TestCase
+class SignupVerificationJobTest extends TestCase
{
/**
* {@inheritDoc}
- *
- * @return void
*/
public function setUp(): void
{
@@ -25,8 +23,6 @@
/**
* {@inheritDoc}
- *
- * @return void
*/
public function tearDown(): void
{
@@ -37,10 +33,8 @@
/**
* Test job handle
- *
- * @return void
*/
- public function testSignupVerificationEmailHandle()
+ public function testHandle(): void
{
$tenant = Tenant::orderBy('id', 'desc')->first();
$tenant->setSetting('mail.sender.address', 'sender@tenant');
@@ -58,9 +52,11 @@
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new SignupVerificationEmail($code);
+ $job = new SignupVerificationJob($code);
$job->handle();
+ $this->assertSame(SignupVerificationJob::QUEUE, $job->queue);
+
// Assert the email sending job was pushed once
Mail::assertSent(SignupVerification::class, 1);
diff --git a/src/tests/Feature/Jobs/TrialEndEmailTest.php b/src/tests/Feature/Jobs/Mail/TrialEndJobTest.php
rename from src/tests/Feature/Jobs/TrialEndEmailTest.php
rename to src/tests/Feature/Jobs/Mail/TrialEndJobTest.php
--- a/src/tests/Feature/Jobs/TrialEndEmailTest.php
+++ b/src/tests/Feature/Jobs/Mail/TrialEndJobTest.php
@@ -1,19 +1,17 @@
<?php
-namespace Tests\Feature\Jobs;
+namespace Tests\Feature\Jobs\Mail;
-use App\Jobs\TrialEndEmail;
+use App\Jobs\Mail\TrialEndJob;
use App\Mail\TrialEnd;
use App\User;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
-class TrialEndEmailTest extends TestCase
+class TrialEndJobTest extends TestCase
{
/**
* {@inheritDoc}
- *
- * @return void
*/
public function setUp(): void
{
@@ -24,8 +22,6 @@
/**
* {@inheritDoc}
- *
- * @return void
*/
public function tearDown(): void
{
@@ -36,10 +32,8 @@
/**
* Test job handle
- *
- * @return void
*/
- public function testHandle()
+ public function testHandle(): void
{
$status = User::STATUS_ACTIVE | User::STATUS_LDAP_READY | User::STATUS_IMAP_READY;
$user = $this->getTestUser('PaymentEmail@UserAccount.com', ['status' => $status]);
@@ -50,9 +44,11 @@
// Assert that no jobs were pushed...
Mail::assertNothingSent();
- $job = new TrialEndEmail($user);
+ $job = new TrialEndJob($user);
$job->handle();
+ $this->assertSame(TrialEndJob::QUEUE, $job->queue);
+
// Assert the email sending job was pushed once
Mail::assertSent(TrialEnd::class, 1);
diff --git a/src/tests/Feature/SignupInvitationTest.php b/src/tests/Feature/SignupInvitationTest.php
--- a/src/tests/Feature/SignupInvitationTest.php
+++ b/src/tests/Feature/SignupInvitationTest.php
@@ -42,10 +42,10 @@
$this->assertSame(\config('app.tenant_id'), $invitation->tenant_id);
$this->assertTrue(preg_match('/^[a-f0-9-]{36}$/', $invitation->id) > 0);
- Queue::assertPushed(\App\Jobs\SignupInvitationEmail::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\SignupInvitationJob::class, 1);
Queue::assertPushed(
- \App\Jobs\SignupInvitationEmail::class,
+ \App\Jobs\Mail\SignupInvitationJob::class,
function ($job) use ($invitation) {
$inv = TestCase::getObjectProperty($job, 'invitation');
@@ -85,10 +85,10 @@
$invitation->status = SI::STATUS_NEW;
$invitation->save();
- Queue::assertPushed(\App\Jobs\SignupInvitationEmail::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\SignupInvitationJob::class, 1);
Queue::assertPushed(
- \App\Jobs\SignupInvitationEmail::class,
+ \App\Jobs\Mail\SignupInvitationJob::class,
function ($job) use ($invitation) {
$inv = TestCase::getObjectProperty($job, 'invitation');
@@ -104,10 +104,10 @@
$invitation->status = SI::STATUS_NEW;
$invitation->save();
- Queue::assertPushed(\App\Jobs\SignupInvitationEmail::class, 1);
+ Queue::assertPushed(\App\Jobs\Mail\SignupInvitationJob::class, 1);
Queue::assertPushed(
- \App\Jobs\SignupInvitationEmail::class,
+ \App\Jobs\Mail\SignupInvitationJob::class,
function ($job) use ($invitation) {
$inv = TestCase::getObjectProperty($job, 'invitation');

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 10:29 AM (17 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18829012
Default Alt Text
D5106.1775298590.diff (50 KB)

Event Timeline