mirror of
https://github.com/brunofontes/shareit.git
synced 2024-11-24 04:14:57 +00:00
Bruno Fontes
8c0e46538c
These changes will stay here so I can use them as examples to come back later to include some real tests.
33 lines
656 B
PHP
33 lines
656 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use \App\Product;
|
|
use Tests\TestCase;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
class ExampleTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
/**
|
|
* A basic test example.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testBasicTest()
|
|
{
|
|
|
|
$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);
|
|
}
|
|
}
|