Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Created March 8, 2018 02:41
Show Gist options
  • Save jsdecena/f1ef4a6e3033f9ebb57a841416c993cc to your computer and use it in GitHub Desktop.
Save jsdecena/f1ef4a6e3033f9ebb57a841416c993cc to your computer and use it in GitHub Desktop.
Article Api Unit Test File
<?php
namespace Tests\Unit;
use Tests\TestCase;
class ArticleApiUnitTest extends TestCase
{
public function it_can_create_an_article()
{
$data = [
'title' => $this->faker->sentence,
'content' => $this->faker->paragraph
];
$this->post(route('articles.store'), $data)
->dump()
->assertStatus(201)
->assertJson($data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment