I'm learning Laravel and Functional tests. On laravast we have in phpunit.xml:
<php>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
</php>
I can not test on mysql database because when I switch my DB_CONNECTION param to "mysql" I have error "PDOException: SQLSTATE[HY000] [1049] Unknown database ':memory:'".
When I dont use memory all tables are removed from my database: My Test Class looks like that:
class ThreadsTest extends TestCase
{
use DatabaseMigrations;
/** @test */
public function a_user_can_browse_threads()
{
$response = $this->get('/threads');
$response->assertStatus(200);
}
}
Does anybody know how can I test in memory with MySQL ? I can't find any information
Thanks
Aucun commentaire:
Enregistrer un commentaire