Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Utilizing Mongounit's trait to allow for mongo datasources in addition to mysql datasources.
use \Zumba\PHPUnit\Extensions\Mongo\TestTrait as MongoTest;
class DatabaseTestCase extends \PHPUnit_Extensions_Database_TestCase {
use MongoTest {
MongoTest::setUp as mongoSetUp;
MongoTest::tearDown as mongoTearDown;
public function setUp() {
public function tearDown() {
public function getMongoConnection() {
// Implement mongo connection here...
public function getMongoDataSet() {
// Implement setting up fixture data here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment