Changeset 48937 for trunk/tests/phpunit/tests/formatting/WPStripAllTags.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/WPStripAllTags.php
r47122 r48937 10 10 11 11 $text = 'lorem<br />ipsum'; 12 $this->assert Equals( 'loremipsum', wp_strip_all_tags( $text ) );12 $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) ); 13 13 14 14 $text = "lorem<br />\nipsum"; 15 $this->assert Equals( "lorem\nipsum", wp_strip_all_tags( $text ) );15 $this->assertSame( "lorem\nipsum", wp_strip_all_tags( $text ) ); 16 16 17 17 // Test removing breaks is working. 18 18 $text = 'lorem<br />ipsum'; 19 $this->assert Equals( 'loremipsum', wp_strip_all_tags( $text, true ) );19 $this->assertSame( 'loremipsum', wp_strip_all_tags( $text, true ) ); 20 20 21 21 // Test script / style tag's contents is removed. 22 22 $text = 'lorem<script>alert(document.cookie)</script>ipsum'; 23 $this->assert Equals( 'loremipsum', wp_strip_all_tags( $text ) );23 $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) ); 24 24 25 25 $text = "lorem<style>* { display: 'none' }</style>ipsum"; 26 $this->assert Equals( 'loremipsum', wp_strip_all_tags( $text ) );26 $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) ); 27 27 28 28 // Test "marlformed" markup of contents. 29 29 $text = "lorem<style>* { display: 'none' }<script>alert( document.cookie )</script></style>ipsum"; 30 $this->assert Equals( 'loremipsum', wp_strip_all_tags( $text ) );30 $this->assertSame( 'loremipsum', wp_strip_all_tags( $text ) ); 31 31 } 32 32 }
Note: See TracChangeset
for help on using the changeset viewer.