mardi 21 juin 2016

CodeCeption Laravel Unit Testing issue

I am using codeception, I have the following code :

public function testValidation()
{
    $user = User::create();

    $user->username = null;
    $this->assertFalse($user->validate(['username']));

    $user->username = 'John';
    $this->assertFalse($user->validate(['username']));

    $user->username = 'Jim';
    $this->assertTrue($user->validate(['username']));
}

I have included use App\User on the top.

Am i missing

The Error it throws :

[Error] Call to a member function connection() on null

Aucun commentaire:

Enregistrer un commentaire