laracasts/TestDummy

Laracasts\TestDummy\TestDummyException: Could not locate a factory with the name: Larabook\Users\User

Closed this issue · 1 comments

// PoststatusCept.php

am('a Larabook member'); $I->wantTo('I want to post statuses to my profile.'); $I->signIn(); $I->amOnPage('statuses'); $I->postAStatus('My first post!'); $I->seeCurrentUrlEquals('/statuses'); $I->see('My first post!'); # // this my functionalhelper.php haveAnAccount(compact('username', 'email', 'password')); $I = $this->getModule('Laravel4'); $I->amOnPage('/login'); $I->fillField('email', $email); $I->fillField('password', $password); $I->click('Sign In'); } // Fill out the publish status form. @param $body public function postAStatus($body){ $I = $this->getModule('Laravel4'); $I->fillField('body', $body); $I->click('Post Status'); } // Create a Larabook user account in the database. // @param array $overrides @return mixed public function haveAnAccount($overrides = []){ return $this->have('Larabook\Users\User', $overrides); } // Insert a dummy record into a database table. // @param $model @param array $overrides @return mixed public function have($model, $overrides = []){ return TestDummy::create($model, $overrides); } ``` }

Did you declare your Larabook\Users\User in your tests/factories/factories.php

Look here