Level 1
An hour later:
Yes, it is a known bug (or at least a known unexpected behavior), and traditional fix is to override the __construct in the model:
So I've been trying to get our database testing to use transactions, and it hasn't been working - the changes we make in the testing methods leave data behind (changed values, inserted rows, etc) that persist over to the next test, causing them to fail.
Then, on a chance, I commented out the $connection string from the model we were testing, and lo! The RefreshDatabase worked as expected.
Is this a known bug? Is there something else we should be doing to get $connection to work with transactions inside tests?
class Game extends Model
{
/**
* The database connection name.
*
* @var string
*
* Comment this out to get RefreshDatabase to work, yay
*/
// protected $connection = 'specifiedConnection';
Please or to participate in this conversation.