Created
September 16, 2019 04:05
-
-
Save aungwinthant/18d3874a1733dc80548baf71d57c9096 to your computer and use it in GitHub Desktop.
Feature Testing Category
This file contains 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; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
class CategoryTest extends TestCase | |
{ | |
use RefreshDatabase; | |
/** | |
* A basic feature test example. | |
* | |
* @return void | |
*/ | |
public function test_it_can_save_a_new_category() | |
{ | |
$data = [ | |
"name" => "Test Category" | |
]; | |
$response = $this->post('/categories',$data); | |
$this->assertDatabaseHas('categories',$data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment