Changeset 41026 for trunk/tests/phpunit/tests/shortcode.php
- Timestamp:
- 07/11/2017 12:53:33 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/shortcode.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/shortcode.php
r38877 r41026 841 841 return wp_json_encode( $arr ); 842 842 } 843 844 /** 845 * @ticket 37304 846 * 847 * Test 'value' syntax for empty attributes 848 */ 849 function test_empty_single_quote_attribute() { 850 $out = do_shortcode( '[test-shortcode-tag a="foo" b=\'bar\' c=baz foo \'bar\' "baz" ]test empty atts[/test-shortcode-tag]' ); 851 $this->assertEquals( array( 'a' => 'foo', 'b' => 'bar', 'c' => 'baz', 0 => 'foo', 1 => 'bar', 2 => 'baz' ), $this->atts ); 852 } 853 854 /** 855 * @ticket 37304 856 */ 857 function test_positional_atts_single_quotes() { 858 $out = do_shortcode( "[test-shortcode-tag 'something in quotes' 'something else']" ); 859 $this->assertEquals( '', $out ); 860 $this->assertEquals( array( 0 => 'something in quotes', 1 => 'something else' ), $this->atts ); 861 $this->assertEquals( 'test-shortcode-tag', $this->tagname ); 862 } 863 864 /** 865 * @ticket 37304 866 */ 867 function test_positional_atts_mixed_quotes() { 868 $out = do_shortcode( "[test-shortcode-tag 'something in quotes' \"something else\" 123 foo bar='baz' example=\"test\" ]" ); 869 $this->assertEquals( '', $out ); 870 $this->assertEquals( array( 0 => 'something in quotes', 1 => 'something else', 2 => '123', 3 => 'foo', 'bar' => 'baz', 'example' => 'test'), $this->atts ); 871 $this->assertEquals( 'test-shortcode-tag', $this->tagname ); 872 } 843 873 }
Note: See TracChangeset
for help on using the changeset viewer.