function setUp() { parent::setUp(); $this->db_manager = new CSM_MockDBManager(); $this->db_manager->returns('migrate_first_migration', true); $this->db_manager->returns('migrate_second_migration', true); $this->db_manager->returns('migrate_third_migration', true); $this->db_manager->returns('migrate_fourth_migration', true); $this->mock_wpdb = new mock_wpdb(); $this->use_wpdb('mock'); }
function __construct($which_fixtures) { if (is_null(self::$_fixtures)) { self::$_dbh = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHARSET, DB_USER, DB_PASSWORD); self::$_fixtures = new SimpleYamlFixtures(self::$_dbh); self::$fixture_dir = plugin_dir_path(CSM_PLUGIN_FILE) . '/tests/fixtures/'; self::$php_env = array('now' => new SimpleDateTime(), 'secs_per_min' => 60, 'secs_per_hour' => 60 * 60, 'secs_per_day' => 60 * 60 * 24, 'secs_per_week' => 60 * 60 * 24 * 7); $fixture_files = preg_grep('/.*\\.yml$/', scandir(self::$fixture_dir)); foreach ($fixture_files as $fixture_file) { $table = basename($fixture_file, '.yml'); $auto_id_column = array_get(self::$auto_id_fixtures, $table, false); self::$_fixtures->enqueue_yaml($table, self::$fixture_dir . $fixture_file, array('auto_id' => $auto_id_column, 'id_column' => is_string($auto_id_column) ? $auto_id_column : 'id', 'auto_ref' => true, 'php_env' => self::$php_env)); } do_action('csm_migrate_db'); } $this->dbh = self::$_dbh; $this->fixtures = self::$_fixtures; $this->which_fixtures = $which_fixtures; }
function setUp() { parent::setUp(); $this->journal_entry = new CSM_JournalEntry(); }
function setUp() { parent::setUp(); // TODO need setup? }
function __construct() { parent::__construct(array()); }
function setUp() { parent::setUp(); $this->available_contact_methods = array('email' => __('E-mail'), 'phone_home' => 'Phone (Home)'); }
function setUp() { parent::setUp(); $this->journal = CSM_Singleton::get('CSM_Journal'); }
function setUp() { parent::setUp(); $this->person = new CSM_MockPerson(); $this->person->slug = 'root'; }