Skip to content

Instantly share code, notes, and snippets.

@leoallen85
Created August 31, 2011 11:52
Show Gist options
  • Save leoallen85/1183373 to your computer and use it in GitHub Desktop.
Save leoallen85/1183373 to your computer and use it in GitHub Desktop.
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();
}
@leoallen85
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment