May 18, 2020
0
Level 1
Laravel 5.4 DatabaseMigrations issue
While running tests using in-memory sqlite, i'm getting a "no such column" error while using this code:
class myCoolTest extends TestCase
{
use DatabaseMigrations;
protected $user;
public function setUp()
{
parent::setUp();
#$this->artisan('migrate'); <-- if I uncomment this and comment DatabasseMigrations trait, everything works
$this->user = factory(User::class)->create();
}
function test_name() {
// test here
}
phpunit.xml contains:
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
Any ideas?
Please or to participate in this conversation.