Files
exchange/tests/Feature/RegisterTest.php
T

35 lines
724 B
PHP

<?php
namespace Tests\Feature;
use Tests\TestCase;
use App\Marking;
use Artisan;
class RegisterTest extends TestCase
{
protected $marking;
public function setUp(){
parent::setUp();
Artisan::call('db:seed');
$this->marking = factory(Marking::class)->create();
}
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => $this->marking->email,
'password' => 'secret',
'password_confirmation' => 'secret',
'marking' => $this->marking->marking
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);
}
}