Skip to content

Instantly share code, notes, and snippets.

@mrmorris
Created October 22, 2010 15:19
Show Gist options
  • Save mrmorris/640746 to your computer and use it in GitHub Desktop.
Save mrmorris/640746 to your computer and use it in GitHub Desktop.
/**
* @var array
*/
public $fixtures = array();
/**
* List of plugin fixtures to always include
* @var array
*/
public $plugin_fixtures = array(
'plugin.messaging.message',
'plugin.messaging.message_deployment'
);
/**
* @return void
*/
public function __construct() {
if (get_class($this) != 'HlTestCase') {
$fixtures = Cache::read('all', 'fixtures');
if (empty($fixtures)) {
$folder = new Folder(TESTS . 'fixtures');
$contents = $folder->read();
$fixtures = array();
foreach($contents[1] as $file) {
$fixtures[] = 'app.'.str_replace('_fixture.php', '', $file);
}
Cache::write('all', $fixtures, 'fixtures');
}
$this->fixtures = array_merge($fixtures, $this->fixtures);
$this->fixtures = array_merge($this->fixtures, $this->plugin_fixtures);
}
parent::__construct();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment