Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Utilizing Mongounit's trait to allow for mongo datasources in addition to mysql datasources.
<?php
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() {
$this->mongoSetUp();
parent::setUp();
}
public function tearDown() {
$this->mongoTearDown();
parent::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
You can’t perform that action at this time.