Skip to content

Instantly share code, notes, and snippets.

@kapilkarda
Created January 4, 2022 13:52
Show Gist options
  • Select an option

  • Save kapilkarda/c73433c2767a7f7859915b98d924784d to your computer and use it in GitHub Desktop.

Select an option

Save kapilkarda/c73433c2767a7f7859915b98d924784d to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Feature;
use App\Models\User;
use Tests\ApiTestTrait;
use Tests\TestCase;
class CustomerApiTest extends TestCase
{
use ApiTestTrait;
/**
* A basic feature test example.
*
* @return void
*/
public function test_example()
{
$user = $user = User::factory()->make()->toArray();
$this->response = $this->json(
'POST',
'/api/customers',
$user
);
if($this->response->original['status']) {
$this->response->assertStatus(200);
} else {
$this->response->assertStatus(500);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment