0

My development server is my Windows computer, and I want to test the task I created before using it to my server on real users.

I know about the windows Task scheuduler but it's very limited, and I want to run my task for example, right now and test it before uploading.

What's the best solution for making sure the task is allright before using it in the server?

TheUnreal
  • 18,980
  • 36
  • 129
  • 231

1 Answers1

0

You should always unit test your task, just invoke the methods in your task from within your test methods.

Task

$this->dispatch(new SendWelcomeEmail($user));

Test method

Mail::send(new SendWelcomeEmail($user, $view));

You can also see this thread to know which task scheduler you can use to test your command in some local integration tests.

The easiest altogether is to make a virtual machine that resembles your production server and just test the tasks in there.

Community
  • 1
  • 1
Loek
  • 3,602
  • 18
  • 32