Created
August 31, 2011 11:52
-
-
Save leoallen85/1183373 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public static function setUpBeforeClass() | |
{ | |
Mgo::connect()->gig->drop(); | |
Mgo::connect()->profile->drop(); | |
// Add organiser/artist | |
self::$organiser = new Model_Profile; | |
self::$organiser->type = Model_Profile::TYPE_ORGANISER; | |
self::$organiser->save(); | |
// Create a new gig | |
self::$gig = new Model_Gig; | |
self::$gig->name = 'blah'; | |
self::$gig->organiser_id = self::$organiser->id; | |
self::$gig->save(); | |
self::$artist = new Model_Profile; | |
self::$artist->type = Model_Profile::TYPE_ARTIST; | |
self::$artist->save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm imagining that this sort of logic is incorrect and should be replaced by a provider method with mock objects for each model is that correct? But won't that be slower than having global variables? Or is the pay-off worth the loss in speed?