I am trying to test my eloquent models, but my tests continue to fail with errors "Class" Reddish "not found." If I add a route that uses my eloquent model and just prints some information stored in the database, everything works fine. Only when you try to run phpunit do I get problems with an eloquent absence. My model is in the application / models, so it should be included in the composer class map, and I did composer dump-autoload . I am sure that I am losing sight of something really obvious, but I cannot understand it. Think what the problem is?
My test:
class GameTest extends TestCase { public function setUp(){ $this->game = Game::find(1); } public function testGameInstance(){ $this->assertInstanceOf('Game', $this->game); } }
My model:
class Game extends Eloquent{ protected $table = 'gm_game'; protected $primaryKey = 'game_id'; }
source share