Created
May 28, 2022 09:31
-
-
Save qadirpervez/2834cd9d744d354dd1722e031cb59dbe to your computer and use it in GitHub Desktop.
Mail Test
This file contains hidden or 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
| <?php | |
| namespace Tests\Feature; | |
| use Tests\TestCase; | |
| use Illuminate\Support\Facades\Mail; | |
| use App\Mail\WelcomeNewCustomer; | |
| class CustomerStoreTest extends TestCase | |
| { | |
| public function testIfCustomerIsCreatedItShouldSendAnEmail() | |
| { | |
| Mail::fake(); | |
| $response = $this->postJson('/api/customer', [ | |
| 'name' => 'John Doe', | |
| 'email' => '[email protected]' | |
| ]); | |
| Mail::assertSent(WelcomeNewCustomer::class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment