I'm trying to figure out why when I run make command it doesn't seed my testing database because when my test gets to the method I"m testing it says there are no roles in the database.
<?php
namespace Tests;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class IntegrationTestCase extends TestCase
{
use DatabaseTransactions;
}
Try using the Illuminate\Foundation\Testing\RefreshDatabase trait instead, and also I recommend storing test settings in your phpunit.xml file instead of another .env file.
You can still use mysql if you want, but I've found it sometimes better to use an in memory sqlite database instead. But again, that's ultimately up to you.
In your phpunit.xml file, you would just need to add the following to the php element:
If in the Makefile I filter to a specific test it will pass however if I run phpunit by itself without the filter of a specific test then it'll fail all but a couple of tests.