post_content = new PostContentManager( $this->make(WooCommerceHelper::class, ['isWooCommerceActive' => false]) ); } public function testFilterContentRetainsStructuralTags() { $html = '

some paragraph text

'; expect($this->post_content->filterContent($html, 'full'))->equals( '

some paragraph text

' ); $html = 'spanning'; expect($this->post_content->filterContent($html, 'full'))->equals( '

' . $html . '

' ); $html = '
do not strip this
'; expect($this->post_content->filterContent($html, 'full'))->equals( '

do not strip this

' ); $html = ''; expect($this->post_content->filterContent($html, 'full'))->equals( "" ); $html = '
  1. First item
  2. Second item
'; expect($this->post_content->filterContent($html, 'full'))->equals( "
    \n
  1. First item
  2. \n
  3. Second item
  4. \n
" ); } public function testFilterContentRetainsHeadings() { $html = '

heading 1

'; expect($this->post_content->filterContent($html, 'full'))->equals($html); $html = '

heading 2

'; expect($this->post_content->filterContent($html, 'full'))->equals($html); $html = '

heading 3

'; expect($this->post_content->filterContent($html, 'full'))->equals($html); $html = '

heading 1

'; expect($this->post_content->filterContent($html, 'excerpt')) ->equals('

heading 1

'); $html = '

heading 2

'; expect($this->post_content->filterContent($html, 'excerpt')) ->equals('

heading 2

'); $html = '

heading 3

'; expect($this->post_content->filterContent($html, 'excerpt')) ->equals('

heading 3

'); } public function testFilterContentRetainsTextStyling() { $text_tags = [ 'emphasized>', 'bold', 'strong', 'italic', 'Text
new line', ]; foreach ($text_tags as $html) { expect($this->post_content->filterContent($html, 'full'))->equals( '

' . $html . '

' ); } } public function testFilterContentRetainsImagesAndLinks() { $html = 'some alt'; expect($this->post_content->filterContent($html, 'full'))->equals( '

some alt

' ); $html = 'some link'; expect($this->post_content->filterContent($html, 'full'))->equals( '

' . $html . '

' ); } public function testFilterContentStripsUndesirableTags() { $undesirable_tags = [ '', '