2018-09-07 23:12:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature;
|
|
|
|
|
2018-09-12 19:44:31 +00:00
|
|
|
use \App\Product;
|
2018-09-07 23:12:34 +00:00
|
|
|
use Tests\TestCase;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
|
|
|
|
class ExampleTest extends TestCase
|
|
|
|
{
|
2018-09-12 19:44:31 +00:00
|
|
|
use RefreshDatabase;
|
|
|
|
|
2018-09-07 23:12:34 +00:00
|
|
|
/**
|
|
|
|
* A basic test example.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testBasicTest()
|
|
|
|
{
|
|
|
|
|
2018-09-12 19:44:31 +00:00
|
|
|
$response = $this->get('/');
|
2018-09-07 23:12:34 +00:00
|
|
|
$response->assertStatus(200);
|
2018-09-12 19:44:31 +00:00
|
|
|
|
|
|
|
//Just to remember the assertSee
|
|
|
|
$this->get('/')->assertSee('Login');
|
|
|
|
|
|
|
|
//Learning how to make unit tests with Laravel
|
|
|
|
factory(Product::class)->create();
|
|
|
|
$products = Product::all();
|
|
|
|
$this->assertCount(1, $products);
|
2018-09-07 23:12:34 +00:00
|
|
|
}
|
|
|
|
}
|