function test_get_all() { WDS_Shortcode_Instances::add(new WDS_Shortcode('sc2', array(), 'content')); $shortcode_objects = WDS_Shortcode_Instances::get_all(); $this->assertTrue(is_array($shortcode_objects)); $this->assertEquals(2, count($shortcode_objects)); }
/** * Generates a new unique WDS_Shortcode object to hold this shortcode's data * * @since 0.1.0 * * @param array $atts Array of attributes after shortcode_atts. * @param string $content Shortcode content. * * @return WDS_Shortcode */ public function create_shortcode_object($atts, $content) { $this->shortcode_object = WDS_Shortcode_Instances::add(new WDS_Shortcode($this->shortcode, $atts, $content)); $this->shortcode_object->content(); return $this->shortcode_object; }