/**
  * Return an instance of this class.
  *
  * @since     1.0.0
  *
  * @return    object    A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Initialize the plugin by loading admin scripts & styles and adding a
  * settings page and menu.
  *
  * @since     1.0.0
  */
 private function __construct()
 {
     $plugin = wp_tutorial_maker::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     /*
      * Define custom functionality.
      *
      * Read more about actions and filters:
      * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
      */
     add_action('edited_term', array($this, 'wp_tutorial_maker_option_update'));
     add_action('deleted_term_taxonomy', array($this, 'wp_tutorial_maker_option_delete'));
     add_filter('edit_category_form', array($this, 'tutorial_decider'));
 }
 /**
  * testing the slug name
  */
 function test_plugin_shortname()
 {
     $plugin = wp_tutorial_maker::get_instance();
     $result = $plugin->get_plugin_slug();
     $this->assertEquals('wp-tutorial-maker', $result);
 }
 /**
  * @covers wp_tutorial_maker_Admin::tutorial_decider
  */
 function test_admin_interface_html()
 {
     //setting up subscriber user with admin permission
     $user = new WP_User($this->factory->user->create(array('role' => 'administrator')));
     wp_set_current_user($user->ID);
     $this->auxClass->set_up_post_data();
     $plugin_admin = wp_tutorial_maker_Admin::get_instance();
     //define new term
     $tid = $this->generate_tid();
     //submitting data!
     $plugin_admin->wp_tutorial_maker_option_update($tid);
     //make sure that every option in the HTML interface is there!
     $plugin = wp_tutorial_maker::get_instance();
     $option_array = get_option($plugin->get_plugin_slug());
     $tag_option_array = $option_array[$tid];
     $this->assertNotEmpty($tag_option_array);
     $this->assertNotEmpty($tag_option_array['wptm']);
     $this->assertNotEmpty($tag_option_array['wp_tutorial_maker_nextprev']);
     $this->assertNotEmpty($tag_option_array['wp_tutorial_maker_next_text']);
     $this->assertNotEmpty($tag_option_array['wp_tutorial_maker_prev_text']);
     $this->assertNotEmpty($tag_option_array['wp_tutorial_maker_show_category_index']);
     $this->assertNotEmpty($tag_option_array['wp_tutorial_maker_text_category_link_name']);
     $this->assertNotEmpty($tag_option_array['wp_tutorial_maker_text_category_list']);
 }
 function __construct()
 {
     $this->plugin = wp_tutorial_maker::get_instance();
     $this->plugin_admin = wp_tutorial_maker_Admin::get_instance();
 }