Created
January 5, 2022 06:00
-
-
Save cdmathukiya/611c6238bc77296e6d0bf5deaae56a56 to your computer and use it in GitHub Desktop.
Testcase for store method
This file contains 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 App\Mail\WelcomeNewCustomer; | |
use Illuminate\Support\Facades\Mail; | |
use Tests\TestCase; | |
class CustomerTest extends TestCase | |
{ | |
/** | |
* A basic test example. | |
* | |
* @return void | |
*/ | |
public function test_example() | |
{ | |
$email = "chintance1993@gmail.com"; | |
$response = $this->post('api/customer/save', ['name' => 'CM', 'email' => $email]); | |
Mail::fake(); | |
Mail::to($email)->send(new WelcomeNewCustomer(['user' => "CM"])); | |
Mail::assertSent(WelcomeNewCustomer::class); | |
$response->assertStatus(200); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment