Closed ishan-eventrac closed 2 years ago
@ishan-eventrac generally the test data will be inserted in the test DB as documented here.
You should be able to set the connection of your factory in the initialize
method as follows:
protected function initialize(): void
{
$this->getTable()->setConnection(ConnectionManager::get('test_foo'));
}
In fixture classes there a way to set database connection name(via
$connection
) in order to insert data into that database.How can we achieve same with fixture factories?