-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ public function no_tasks_defined() | |
public function lists_configured_tasks_and_issues() | ||
{ | ||
$runner = (new MockScheduleBuilder()) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->emailOnFailure('[email protected]'); | ||
|
@@ -92,7 +92,7 @@ public function buildSchedule(Schedule $schedule): void | |
public function renders_exception_stack_trace_if_verbose() | ||
{ | ||
$runner = (new MockScheduleBuilder()) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->addCommand('my:command') | ||
|
@@ -129,7 +129,7 @@ public function buildSchedule(Schedule $schedule): void | |
public function lists_configured_tasks_and_issues_in_detail() | ||
{ | ||
$runner = (new MockScheduleBuilder()) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->emailOnFailure('[email protected]'); | ||
|
@@ -186,7 +186,7 @@ public function command_task_with_invalid_argument_shows_as_error() | |
; | ||
|
||
$application = new Application(); | ||
$application->add(new class() extends Command { | ||
$application->add(new class extends Command { | ||
public static function getDefaultName(): string | ||
{ | ||
return 'my:command'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ public function sends_schedule_failure_email() | |
|
||
(new MockScheduleBuilder()) | ||
->addHandler(new EmailHandler($mailer, '[email protected]', '[email protected]')) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->emailOnFailure(); | ||
|
@@ -71,7 +71,7 @@ public function sends_schedule_failure_email_with_overrides() | |
|
||
(new MockScheduleBuilder()) | ||
->addHandler(new EmailHandler($mailer, '[email protected]', '[email protected]')) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->emailOnFailure('[email protected]', 'my subject', function(Email $email) { | ||
|
@@ -99,7 +99,7 @@ public function sends_schedule_failure_email_with_configured_subject_prefix() | |
|
||
(new MockScheduleBuilder()) | ||
->addHandler(new EmailHandler($mailer, '[email protected]', '[email protected]', '[Acme Inc]')) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->emailOnFailure(); | ||
|
@@ -247,7 +247,7 @@ public function provides_helpful_message_if_handler_not_configured() | |
$this->expectExceptionMessage('To use the email extension you must configure a mailer (config path: "zenstruck_schedule.mailer").'); | ||
|
||
(new MockScheduleBuilder()) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->emailOnFailure(); | ||
|
@@ -290,7 +290,7 @@ public function email_shows_if_task_was_force_run() | |
|
||
private function createMailer(): MailerInterface | ||
{ | ||
return new class() implements MailerInterface { | ||
return new class implements MailerInterface { | ||
/** @var RawMessage */ | ||
public $lastMessage; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ public function sends_schedule_failure_notification() | |
|
||
(new MockScheduleBuilder()) | ||
->addHandler(new NotifierHandler($notifier, ['chat/slack'], '[email protected]', '123456789')) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->notifyOnFailure(); | ||
|
@@ -72,7 +72,7 @@ public function sends_schedule_failure_notification_with_overrides() | |
|
||
(new MockScheduleBuilder()) | ||
->addHandler(new NotifierHandler($notifier, ['chat/slack'], '[email protected]', '127.0.0.1')) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->notifyOnFailure('teams', null, null, 'my subject', function(Notification $notification) { | ||
|
@@ -100,7 +100,7 @@ public function sends_schedule_failure_notification_with_configured_subject_pref | |
|
||
(new MockScheduleBuilder()) | ||
->addHandler(new NotifierHandler($notifier, ['chat/slack'], '[email protected]', '[email protected]', '[Acme Inc]')) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->notifyOnFailure(); | ||
|
@@ -251,7 +251,7 @@ public function provides_helpful_message_if_handler_not_configured() | |
$this->expectExceptionMessage('To use the notifier extension you must configure a notifier (config path: "zenstruck_schedule.notifier").'); | ||
|
||
(new MockScheduleBuilder()) | ||
->addBuilder(new class() implements ScheduleBuilder { | ||
->addBuilder(new class implements ScheduleBuilder { | ||
public function buildSchedule(Schedule $schedule): void | ||
{ | ||
$schedule->notifyOnFailure(); | ||
|
@@ -294,7 +294,7 @@ public function notification_shows_if_task_was_force_run() | |
|
||
private function createNotifier(): NotifierInterface | ||
{ | ||
return new class() implements NotifierInterface { | ||
return new class implements NotifierInterface { | ||
/** @var Notification */ | ||
public $lastNotification; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters