mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
Including first Laravel UnitText Experience
These changes will stay here so I can use them as examples to come back later to include some real tests.
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use \App\Product;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
@@ -14,8 +17,16 @@ class ExampleTest extends TestCase
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response = $this->get('/');
|
||||
$response->assertStatus(200);
|
||||
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user