Changeset 881 in tests for trunk/tests/test_shortcode.php
- Timestamp:
- 07/03/2012 09:43:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/test_shortcode.php
r847 r881 254 254 } 255 255 256 /*257 enabled = the shortcode works as normal (default)258 strip = the shortcode will be parsed and removed. e.g. '[shortcode foo="bar"]' produces ''. '[shortcode]foo[/shortcode]' produces 'foo'.259 faux = the shortcode will be abbreviated. e.g. '[shortcode foo="bar"]' products '[shortcode]'. '[shortocde]foo[/shortcode]' produces '[shortcode]'260 disabled = the shortcode is not parsed at all. e.g. '[shortcode foo="bar"]' products '[shortcode foo="bar"]'261 */262 263 function test_shortcodes_enabled() {264 if ( !is_callable('set_all_shortcode_status') )265 $this->markTestSkipped();266 set_all_shortcode_status('enabled');267 $out = do_shortcode("[baztag]foo is [footag foo='bar'][/baztag]");268 $expected = 'content = foo is foo = bar';269 $this->assertEquals( $expected, $out );270 }271 272 function test_shortcodes_disabled() {273 if ( !is_callable('set_all_shortcode_status') )274 $this->markTestSkipped();275 set_all_shortcode_status('disabled');276 $out = do_shortcode("[baztag]foo is [footag foo='bar'][/baztag]");277 $expected = $out;278 $this->assertEquals( $expected, $out );279 }280 281 function test_shortcodes_strip() {282 if ( !is_callable('set_all_shortcode_status') )283 $this->markTestSkipped();284 set_all_shortcode_status('strip');285 $out = do_shortcode("[baztag]foo is [footag foo='bar'][/baztag]");286 $expected = 'foo is ';287 $this->assertEquals( $expected, $out );288 }289 290 function test_shortcodes_faux() {291 if ( !is_callable('set_all_shortcode_status') )292 $this->markTestSkipped();293 set_all_shortcode_status('faux');294 $out = do_shortcode("[baztag]foo is [footag foo='bar'][/baztag]");295 $expected = '[baztag]';296 $this->assertEquals( $expected, $out );297 }298 299 256 function test_shortcode_unautop() { 300 257 // a blank line is added at the end, so test with it already there
Note: See TracChangeset
for help on using the changeset viewer.