Created
January 3, 2022 08:03
-
-
Save paradisetester/5da0d0d06143ecbd31533d74342be367 to your computer and use it in GitHub Desktop.
Using laravel's HTTP tests
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 Illuminate\Foundation\Testing\RefreshDatabase; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Tests\TestCase; | |
class CustomerTest extends TestCase | |
{ | |
/** | |
* A basic feature test example. | |
* | |
* @return void | |
*/ | |
public function test_example() | |
{ | |
// $response = $this->get('/customer'); | |
$response = $this->withHeaders([ | |
'X-Header' => 'Value', | |
])->post('/customer', ['name' => 'sd','email' => '[email protected]']); | |
$response->assertStatus(201); | |
} | |
} |
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
@component('mail::message') | |
{{__('Mail Sent')}} | |
Thanks,<br> | |
{{ config('app.name') }} | |
@endcomponent |
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 App\Mail; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Mail\Mailable; | |
use Illuminate\Queue\SerializesModels; | |
class WelcomeNewCustomer extends Mailable | |
{ | |
use Queueable, SerializesModels; | |
/** | |
* Create a new message instance. | |
* | |
* @return void | |
*/ | |
public function __construct() | |
{ | |
// | |
} | |
/** | |
* Build the message. | |
* | |
* @return $this | |
*/ | |
public function build() | |
{ | |
return $this->from('[email protected]', 'Customer') | |
->markdown('emails.template'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment