/** * Assert that emails are sent using the command send:email * * @return void */ public function testItSendsEmailToInterestedSubscribers() { $totalSubscribers = Subscription::count(); $subscriber = factory(Subscription::class)->create(['confirmed' => true, 'active' => true]); $this->assertTrue($totalSubscribers < Subscription::count()); $subscriber->topics()->detach(); foreach (Tag::all() as $tag) { $subscriber->topics()->save($tag); } $this->assertTrue($subscriber->topics()->get()->count() == Tag::count()); // $this->expectsJobs(SendNewsletter::class); Artisan::call("emails:send", ['timestamp' => 1]); $logFile = file_get_contents(storage_path() . '/logs/laravel.log'); $this->assertTrue(strpos($logFile, $subscriber->email) !== false); }