Conterno's avatar

Access Certain Production Data from Testing Environment

I usually run my tests with an in-memory sqlite database. However, there is one production database that has information I need to properly perform certain tests within the testing environment. How can I get access to that production data if I specify a different database connection for my testing environment in phpunit.xml?

It's not a huge dataset, around a hundred records. But it's frequently used across multiple tests.

Possible Ideas

  • Copy the database using a seeder?
  • When initiating the test suite, make this one db actually call the real one?
0 likes
1 reply
ifpingram's avatar

"Copy the database using a seeder?" - this one; never access production databases from tests!

Please or to participate in this conversation.