Last active
December 27, 2015 01:09
-
-
Save cjsaylor/7243308 to your computer and use it in GitHub Desktop.
Utilizing Mongounit's trait to allow for mongo datasources in addition to mysql datasources.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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