JeffreyWay / Laravel-Test-Helpers

Easier testing in Laravel.
https://packagist.org/packages/way/laravel-test-helpers
217 stars 40 forks source link

$this->tableName and $this->class->getTable() #51

Open reedmaniac opened 10 years ago

reedmaniac commented 10 years ago

Why is the Factory::fire() method trying to build its own table name using $this->parseTableName() instead of using the one defined in the Model itself? Seems like this:

$this->tableName = $this->parseTableName($class);
$this->class = $this->createModel($class);

Could easily become this:

$this->class = $this->createModel($class);
$this->tableName = $this->class->getTable();

This was causing a problem as my Eloquent class names and table names do not line up that often.

ceesvanegmond commented 10 years ago

+1