Given that I have accidentally deleted and had to restore my local database three times in the last 2 hours, I am reaching out for help.
I have been using sqlite in :memory: for testing but I am starting to use some features not available in sqlite so I want to test on a mysql ddb.
[1] I created a new database called atc_phpunit (atc is the prod database)
[2] I modified my phpunit.xml file
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="mysql"/>
<server name="DB_DATABASE" value="atc_phpunit"/>
<!-- <server name="DB_CONNECTION" value="sqlite"/>-->
<!-- <server name="DB_DATABASE" value=":memory:"/>-->
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
</php>
[3] I added Refresh Database to my TestCase
<?php
namespace Tests;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication, RefreshDatabase;
}
[4] I run php artisan migrate --env=testing and get nothing to migrate
[5] I run my test suite and my local database is now empty
LOL, after three times, I think I may be missing a step???