|
2 | 2 |
|
3 | 3 | namespace BeyondCode\HeloLaravel\Tests;
|
4 | 4 |
|
5 |
| -use BeyondCode\HeloLaravel\HeloLaravelServiceProvider; |
6 | 5 | use BeyondCode\HeloLaravel\Mailer;
|
7 | 6 | use BeyondCode\HeloLaravel\Laravel7Mailer;
|
8 | 7 | use BeyondCode\HeloLaravel\TestMail;
|
9 | 8 | use BeyondCode\HeloLaravel\TestMailCommand;
|
10 | 9 | use Illuminate\Support\Facades\Mail;
|
11 |
| -use Orchestra\Testbench\TestCase; |
12 | 10 |
|
13 |
| -class HeloTest extends TestCase |
14 |
| -{ |
15 |
| - protected function getPackageProviders($app) |
16 |
| - { |
17 |
| - return [ |
18 |
| - HeloLaravelServiceProvider::class |
19 |
| - ]; |
20 |
| - } |
| 11 | +uses(TestCase::class); |
21 | 12 |
|
22 |
| - /** @test */ |
23 |
| - public function test_the_mail_commands_sends_the_mailable() |
24 |
| - { |
25 |
| - Mail::fake(); |
| 13 | +test('the mail commands sends the mailable', function () |
| 14 | +{ |
| 15 | + Mail::fake(); |
26 | 16 |
|
27 |
| - $this->artisan(TestMailCommand::class); |
| 17 | + $this->artisan(TestMailCommand::class); |
28 | 18 |
|
29 |
| - Mail::assertSent(TestMail::class); |
30 |
| - } |
| 19 | + Mail::assertSent(TestMail::class); |
| 20 | +}); |
31 | 21 |
|
32 |
| - /** @test */ |
33 |
| - public function test_plain_text_mails_work_correctly() |
34 |
| - { |
35 |
| - Mail::fake(); |
| 22 | +test('plain text mails work correctly(', function () |
| 23 | +{ |
| 24 | + Mail::fake(); |
36 | 25 |
|
37 |
| - Mail:: to( '[email protected]')-> send( new TestMail( true)); |
| 26 | + Mail:: to( '[email protected]')-> send( new TestMail( true)); |
38 | 27 |
|
39 |
| - Mail::assertSent(TestMail::class); |
40 |
| - } |
| 28 | + Mail::assertSent(TestMail::class); |
| 29 | +}); |
41 | 30 |
|
42 |
| - /** @test */ |
43 |
| - public function test_the_correct_mailer_is_binded() |
44 |
| - { |
45 |
| - $mailer = app(Mailer::class); |
| 31 | +test('the correct mailer is binded', function () { |
| 32 | + $mailer = app(Mailer::class); |
46 | 33 |
|
47 |
| - if (version_compare(app()->version(), '7.0.0', '<')) { |
48 |
| - $this->assertTrue($mailer instanceof Mailer); |
49 |
| - } else { |
50 |
| - $this->assertTrue($mailer instanceof Laravel7Mailer); |
51 |
| - } |
| 34 | + if (version_compare(app()->version(), '7.0.0', '<')) { |
| 35 | + $this->assertTrue($mailer instanceof Mailer); |
| 36 | + } else { |
| 37 | + $this->assertTrue($mailer instanceof Laravel7Mailer); |
52 | 38 | }
|
53 |
| -} |
| 39 | +}); |
0 commit comments