Created
March 14, 2018 01:40
-
-
Save jsdecena/2588cb2e5f9b0ad3c01a932137db68bf to your computer and use it in GitHub Desktop.
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 Tests\TestCase; | |
class ArticleTest extends TestCase | |
{ | |
/** @test */ | |
public function it_can_create_an_article() | |
{ | |
$title = $this->faker->word; | |
$data = [ | |
'title' => $title, | |
'slug' => str_slug($title), | |
'excerpt' => $this->faker->sentence, | |
'content' => $this->faker->paragraph, | |
'author_id' => 1, | |
'status_id' => 1, | |
'date_start' => null, | |
'date_end' => null | |
]; | |
$this->post("api/v1/articles", $data) | |
->assertStatus(201) | |
->assertJsonStructure(array_keys($data), $data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment