@@ -46,33 +46,17 @@ function an_email_should_not_be_sent_once_it_is_marked_as_sent()
4646 $ this ->assertEquals ($ firstSend , $ email ->fresh ()->getSendDate ());
4747 }
4848
49- /** @test */
50- function an_email_should_be_locked_so_overlapping_cronjobs_cannot_send_an_already_processing_email ()
51- {
52- $ email = $ this ->sendEmail ();
53-
54- Event::listen ('before.send ' , function () {
55- $ this ->artisan ('email:send ' );
56- });
57-
58- $ this ->artisan ('email:send ' );
59-
60- $ this ->assertEquals (1 , $ email ->fresh ()->getAttempts ());
61- }
62-
6349 /** @test */
6450 function if_an_email_fails_to_be_sent_it_should_be_logged_in_the_database ()
6551 {
66- $ email = $ this -> sendEmail () ;
52+ $ this -> app [ ' config ' ][ ' mail.driver ' ] = ' does-not-exist ' ;
6753
68- Event::listen ('before.send ' , function () {
69- throw new \Exception ('Simulating some random error ' );
70- });
54+ $ email = $ this ->sendEmail ();
7155
7256 $ this ->artisan ('email:send ' );
7357
7458 $ this ->assertTrue ($ email ->fresh ()->hasFailed ());
75- $ this ->assertContains ('Simulating some random error ' , $ email ->fresh ()->getError ());
59+ $ this ->assertContains ('Driver [does-not-exist] not supported. ' , $ email ->fresh ()->getError ());
7660 }
7761
7862 /** @test */
@@ -109,9 +93,7 @@ function an_email_should_never_be_sent_before_its_scheduled_date()
10993 /** @test */
11094 function emails_will_be_sent_until_max_try_count_has_been_reached ()
11195 {
112- Event::listen ('before.send ' , function () {
113- throw new \Exception ('Simulating some random error ' );
114- });
96+ $ this ->app ['config ' ]['mail.driver ' ] = 'does-not-exist ' ;
11597
11698 $ this ->sendEmail ();
11799 $ this ->assertCount (1 , (new Store )->getQueue ());
0 commit comments