public function setUp()
 {
     EEM_Payment::reset();
     EEM_Transaction::reset();
     //		EEM_Payment_Method::reset();
     parent::setUp();
 }
 public function setUp()
 {
     //for the testing's sake, we want events to be related to paymetn methods via a HABTM_Any relation
     add_filter('FHEE__EEM_Event__construct__model_relations', array($this, 'relate_events_to_payment_methods'));
     add_filter('FHEE__EEM_Payment_Method__construct__model_relations', array($this, 'relate_payment_methods_to_events'));
     parent::setUp();
 }
 /**
  * remember teh espresso_db_update's option before these tests
  */
 function setUp()
 {
     parent::setUp();
     $this->_original_espresso_db_update = get_option('espresso_db_update');
     $this->_original_db_state = get_option(EE_Data_Migration_Manager::current_database_state);
     EE_System::reset();
 }
 public function setUp()
 {
     parent::setUp();
     //make sure caf payment methods are registered
     new EE_Brewing_Regular();
     EE_Payment_Method_Manager::reset();
 }
 public function setUp()
 {
     parent::setUp();
     $this->event_term = $this->new_model_obj_with_dependencies('Term');
     $this->new_model_obj_with_dependencies('Term_Taxonomy', array('term_id' => $this->event_term->ID(), 'taxonomy' => 'espresso_event_categories'));
     $this->venue_term = $this->new_model_obj_with_dependencies('Term');
     $this->new_model_obj_with_dependencies('Term_Taxonomy', array('term_id' => $this->venue_term->ID(), 'taxonomy' => 'espresso_venue_categories'));
 }
 public function setUp()
 {
     parent::setUp();
     $this->_validator = new EE_Text_Validation_Strategy('oups', '~Darth ([\\w]*)~');
     $input = new EE_Text_Input();
     //finalize its construction, but we don't actually need the input anyways
     $this->_validator->_construct_finalize($input);
 }
 public function setUp()
 {
     parent::setUp();
     //clean out hte WP User table for these tests
     EEM_WP_User::instance()->delete(array(), false);
     $this->me = $this->factory->user->create_and_get();
     $this->somebody_else = $this->factory->user->create_and_get();
 }
 function setUp()
 {
     parent::setUp();
     add_filter('filesystem_method_file', array($this, 'filter_abstraction_file'));
     add_filter('filesystem_method', array($this, 'filter_fs_method'));
     WP_Filesystem();
     global $wp_filesystem;
     $wp_filesystem->init('/');
 }
 function setUp()
 {
     parent::setUp();
     add_filter('filesystem_method_file', array($this, 'filter_abstraction_file'));
     add_filter('filesystem_method', array($this, 'filter_fs_method'));
     add_filter('FHEE__EEH_File___get_wp_filesystem__allow_using_filesystem_direct', '__return_false');
     WP_Filesystem();
     global $wp_filesystem;
     $wp_filesystem->init('/');
 }
 /**
  * used to set the admin page mock
  */
 public function setUp()
 {
     parent::setUp();
     $this->loadAdminMocks();
     $this->_eeAdminMock = new Admin_Mock_Valid_Admin_Page(false);
     $this->_testRoute = admin_url('admin.php?page=mock_valid_admin_page');
     //go to mock_valid_admin_page route for test
     $this->go_to($this->_testRoute);
     $this->defineAdminConstants();
     $this->_eeAdminHookMock = new mock_valid_admin_page_Admin_Mock_Valid_Hooks($this->_eeAdminMock);
 }
 public function setUp()
 {
     parent::setUp();
     require_once EE_TESTS_DIR . 'mocks/core/Psr4AutoloaderMock.php';
     $this->loader = new Psr4AutoloaderMock();
     $this->loader->setFiles(array('/vendor/foo.bar/src/ClassName.php', '/vendor/foo.bar/src/DoomClassName.php', '/vendor/foo.bar/tests/ClassNameTest.php', '/vendor/foo.bardoom/src/ClassName.php', '/vendor/foo.bar.baz.dib/src/ClassName.php', '/vendor/foo.bar.baz.dib.zim.gir/src/ClassName.php'));
     $this->loader->addNamespace('Foo\\Bar', '/vendor/foo.bar/src');
     $this->loader->addNamespace('Foo\\Bar', '/vendor/foo.bar/tests');
     $this->loader->addNamespace('Foo\\BarDoom', '/vendor/foo.bardoom/src');
     $this->loader->addNamespace('Foo\\Bar\\Baz\\Dib', '/vendor/foo.bar.baz.dib/src');
     $this->loader->addNamespace('Foo\\Bar\\Baz\\Dib\\Zim\\Gir', '/vendor/foo.bar.baz.dib.zim.gir/src');
 }
 public function setUp()
 {
     parent::setUp();
     $this->user = $this->factory->user->create_and_get();
     $this->my_event = $this->new_model_obj_with_dependencies('Event', array('EVT_wp_user' => $this->user->ID));
     $term_id_and_taxonomy_id = wp_insert_term('term_r_for_my_event', 'espresso_event_categories');
     $result = wp_set_object_terms($this->my_event->ID(), $term_id_and_taxonomy_id['term_id'], 'espresso_event_categories');
     $this->term_r_for_my_event = EEM_Term_Relationship::instance()->get_one(array(array('object_id' => $this->my_event->ID(), 'term_taxonomy_id' => reset($result))));
     $this->others_event = $this->new_model_obj_with_dependencies('Event', array('EVT_wp_user' => $this->user->ID + 1));
     $term_id_and_taxonomy_id = wp_insert_term('term_r_for_others_event', 'espresso_event_categories');
     $result = wp_set_object_terms($this->others_event->ID(), $term_id_and_taxonomy_id['term_id'], 'espresso_event_categories');
     $this->term_r_for_others_event = EEM_Term_Relationship::instance()->get_one(array(array('object_id' => $this->others_event->ID(), 'term_taxonomy_id' => reset($result))));
 }
 /**
  * setUp
  */
 public function setUp()
 {
     $return_value = parent::setUp();
     //EEG_Paypal_Pro uses $_SERVER at some point, so we need to pretend this is a regular request
     $this->go_to('http://localhost/');
     //just set a random address
     $_SERVER['REMOTE_ADDR'] = '192.0.0.1';
     add_filter('FHEE__EEG_Paypal_Pro__CurlRequest__CURLOPT_VERBOSE', '__return_false');
     //make sure caf payment methods are registered
     new EE_Brewing_Regular();
     EE_Payment_Method_Manager::reset();
     return $return_value;
 }
 public function setUp()
 {
     parent::setUp();
     //let's just make a generic addon, but not bother registering it
     $this->_addon = EE_Registry::instance()->load_addon(dirname($this->_main_file_path), 'EE_New_Addon');
     $this->_addon->set_name('New_Addon');
     $this->_addon->set_main_plugin_file($this->_main_file_path);
     $this->_addon->set_version('1.0.0');
     $this->_addon->set_min_core_version('4.0.0');
     //		$addon->set_config_section( self::$_settings[ $addon_name ]['config_section'] );
     //		$addon->set_config_class( self::$_settings[ $addon_name ]['config_class'] );
     //		$addon->set_config_name( self::$_settings[ $addon_name ]['config_name'] );
     add_filter('FHEE__EEH_Activation__create_table__short_circuit', array($this, 'dont_short_circuit_new_addon_table'), 20, 3);
 }
 public function setUp()
 {
     parent::setUp();
     //all shortcode parse tests will require a full event to be setup with some datetimes and tickets.
     $price = $this->factory->price_chained->create_object(array('PRC_name' => 'Not Free Price', 'PRC_amount' => '125.00'));
     $this->_ticket = $this->factory->ticket_chained->create_object(array('PRC_ID' => $price->ID()));
     //update ticket price
     $this->_ticket->set('TKT_price', '125.00');
     $this->_ticket->set('TKT_name', 'Podracing Entry');
     $this->_ticket->set('TKT_description', 'One entry in the event.');
     $this->_datetime = $this->_ticket->first_datetime();
     $this->_event = $this->_datetime->event();
     //set the author of the event
     $this->_event->set('EVT_wp_user', 1);
 }
 public function setUp()
 {
     parent::setUp();
     //let's make sure we start off with NO tickets in the DB
     EEM_Ticket::instance()->delete_permanently(EEM_Ticket::instance()->alter_query_params_so_deleted_and_undeleted_items_included(), false);
     $this->assertEquals(0, EEM_Ticket::instance()->count(EEM_Ticket::instance()->alter_query_params_so_deleted_and_undeleted_items_included()));
     $this->user = $this->factory->user->create_and_get();
     $this->e_mine = $this->new_model_obj_with_dependencies('Event', array('EVT_wp_user' => $this->user->ID, 'status' => 'publish'));
     $this->e_others = $this->new_model_obj_with_dependencies('Event', array('EVT_wp_user' => 99999, 'status' => 'publish'));
     $this->e_private = $this->new_model_obj_with_dependencies('Event', array('EVT_wp_user' => 99999, 'status' => 'private'));
     $this->t_mine = $this->new_model_obj_with_dependencies('Ticket', array('TKT_is_default' => false, 'TKT_wp_user' => $this->user->ID));
     $this->t_others = $this->new_model_obj_with_dependencies('Ticket', array('TKT_is_default' => false, 'TKT_wp_user' => 9999));
     $this->t_private = $this->new_model_obj_with_dependencies('Ticket', array('TKT_is_default' => false, 'TKT_wp_user' => 9999));
     $this->t_mine_default = $this->new_model_obj_with_dependencies('Ticket', array('TKT_is_default' => true, 'TKT_wp_user' => $this->user->ID));
     $this->t_others_default = $this->new_model_obj_with_dependencies('Ticket', array('TKT_is_default' => true, 'TKT_wp_user' => 9999));
     $dtt_to_mine = $this->new_model_obj_with_dependencies('Datetime', array('EVT_ID' => $this->e_mine->ID()));
     $dtt_to_mine->_add_relation_to($this->t_mine, 'Ticket');
     $dtt_to_others = $this->new_model_obj_with_dependencies('Datetime', array('EVT_ID' => $this->e_others->ID()));
     $dtt_to_others->_add_relation_to($this->t_others, 'Ticket');
     $dtt_to_private = $this->new_model_obj_with_dependencies('Datetime', array('EVT_ID' => $this->e_private->ID()));
     $dtt_to_private->_add_relation_to($this->t_private, 'Ticket');
 }
 public function setUp()
 {
     parent::setUp();
     add_filter('FHEE__EEH_Activation__create_table__short_circuit', array($this, 'dont_short_circuit_new_addon_table'), 20, 3);
 }
 public function setUp()
 {
     parent::setUp();
     $this->loadAdminMocks();
 }
    public function setUp()
    {
        parent::setUp();
        EE_Registry::instance()->load_helper('Activation');
        //whitelist the table we're about to add
        add_filter('FHEE__EEH_Activation__create_table__short_circuit', array($this, 'dont_short_circuit_mock_table'), 25, 3);
        //add table from related DMS
        EEH_Activation::create_table('esp_mock_attendee_meta', '
			MATTM_ID int(10) unsigned NOT NULL AUTO_INCREMENT,
			ATT_ID int(10) unsigned NOT NULL,
			ATT_foobar int(10) unsigned NOT NULL,
			PRIMARY KEY  (MATTM_ID)');
        $this->assertTableExists('esp_mock_attendee_meta');
        EE_Register_Model_Extensions::deregister($this->_model_group);
    }
 public function setUp()
 {
     //set timezone string.  NOTE, this is purposely a high positive timezone string because it works better for testing expiry times.
     update_option('timezone_string', 'Australia/Sydney');
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
     EE_Cart::reset();
 }
 /**
  * the DMS manager maintains a bit of state in order to be more efficient, which we want to lose between tests
  */
 public function setUp()
 {
     EE_Data_Migration_Manager::reset();
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
     $this->delayedAdminPageMocks('registrations');
 }
 public function setUp()
 {
     parent::setUp();
     $this->_pretend_addon_hook_time();
     EE_Register_Payment_Method::register('onsite', array('payment_method_paths' => array(EE_TESTS_DIR . 'mocks' . DS . 'payment_methods' . DS . 'Mock_Onsite')));
     EE_Register_Payment_Method::register('offsite', array('payment_method_paths' => array(EE_TESTS_DIR . 'mocks' . DS . 'payment_methods' . DS . 'Mock_Offsite')));
     EE_Payment_Method_Manager::instance()->reset();
     //remove all actions that have been added by messages because we aren't testing them here.
     remove_all_actions('AHEE__EE_Payment_Processor__update_txn_based_on_payment__successful');
     remove_all_actions('AHEE__EE_Payment_Processor__update_txn_based_on_payment__no_payment_made');
     remove_all_actions('AHEE__EE_Payment_Processor__update_txn_based_on_payment__not_successful');
     remove_all_actions('AHEE__EE_Payment_Processor__update_txn_based_on_payment');
 }
 /**
  * Registers the mock addon so it can be used for testing
  */
 public function setUp()
 {
     parent::setUp();
     $this->_pretend_addon_hook_time();
     $mock_addon_path = EE_TESTS_DIR . 'mocks/addons/eea-new-addon/';
     EE_Register_Addon::register($this->_addon_name, array('version' => '1.0.0.dev.000', 'min_core_version' => '4.0.0', 'main_file_path' => $mock_addon_path . 'eea-new-addon.php', 'dms_paths' => $mock_addon_path . 'core/data_migration_scripts'));
     //double-check that worked fine
     $this->assertAttributeNotEmpty('EE_New_Addon', EE_Registry::instance()->addons);
     $DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available();
     $this->assertArrayHasKey('EE_DMS_New_Addon_1_0_0', $DMSs_available);
     //ensure this is the only addon
     $this->assertEquals(1, count(EE_Registry::instance()->addons));
     $this->_addon = EE_Registry::instance()->addons->EE_New_Addon;
     $this->assertTrue($this->_addon instanceof EE_New_Addon);
     $this->_addon_classname = get_class($this->_addon);
     $this->_addon_activation_history = $this->_addon->get_activation_history();
     $this->_current_db_state = get_option(EE_Data_Migration_Manager::current_database_state);
     delete_option(EE_Data_Migration_Manager::current_database_state);
     update_option(EE_Data_Migration_Manager::current_database_state, array('Core' => espresso_version()));
     add_filter('FHEE__EEH_Activation__create_table__short_circuit', array($this, 'dont_short_circuit_new_addon_table'), 20, 3);
 }
 public function setUp()
 {
     require_once EE_TESTS_DIR . 'mocks/EE_Collection_Mock.php';
     $this->collection = new EE_Collection_Mock();
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
     $this->_stop_pretending_addon_hook_time();
     //		EE_System::instance()->load_core_configuration();
 }
 public function setUp()
 {
     parent::setUp();
     $this->loadModelFieldMocks(array('EE_Datetime_Field'));
 }
 function setUp()
 {
     parent::setUp();
     EEH_Autoloader::register_line_item_filter_autoloaders();
 }
 public function setUp()
 {
     require_once EE_TESTS_DIR . 'mocks/EE_Repository_Mock.php';
     $this->repository = new EE_Repository_Mock();
     parent::setUp();
 }