HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/MdnDirecteur/hours.komma.cloud/tests/Unit/UserTests.php
<?php

namespace Tests;

use App\User;
use Illuminate\Support\Facades\Session;

class UserTests extends TestCase
{


    /**
     * A basic test example.
     *
     * @return void
     */
    public function testUnauthorizedAccess()
    {
        $response = $this->followingRedirects()->get('/');
        $response->assertStatus(200);
        $response->assertViewIs('auth.login');
    }

    public function testUserCanWiewLoginForm()
    {
        $response = $this->get('login');
        $response->assertSuccessful();
        $response->assertViewIs('auth.login');
    }

    public function testWrongLoginPost(){
        $response = $this->followingRedirects()->get('/hours');
        $response->assertStatus(200);
    }

    public function testCorrectLogin(){
        Session::start();
        $user = User::first();
        $this->be($user);
        $response = $this->get('/hours');
        $response->assertStatus(200);
    }



}