Skip to content

Instantly share code, notes, and snippets.

@paradisetester
Created January 3, 2022 08:03
Show Gist options
  • Save paradisetester/5da0d0d06143ecbd31533d74342be367 to your computer and use it in GitHub Desktop.
Save paradisetester/5da0d0d06143ecbd31533d74342be367 to your computer and use it in GitHub Desktop.
Using laravel's HTTP tests
<?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);
}
}
@component('mail::message')
{{__('Mail Sent')}}
Thanks,<br>
{{ config('app.name') }}
@endcomponent
<?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