Created
March 8, 2018 02:41
-
-
Save jsdecena/f1ef4a6e3033f9ebb57a841416c993cc to your computer and use it in GitHub Desktop.
Article Api Unit Test File
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\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