| | 975 | |
| | 976 | public function data_shortcode_parse_atts() { |
| | 977 | |
| | 978 | return [ |
| | 979 | [ |
| | 980 | '[unittest]', |
| | 981 | '', |
| | 982 | ], |
| | 983 | [ |
| | 984 | '[unitest]Unit Test[/unittest]', |
| | 985 | '', |
| | 986 | ], |
| | 987 | [ |
| | 988 | '[unittest title="unittest" link="https://unit.test/"]', |
| | 989 | [ |
| | 990 | 'title' => 'unittest', |
| | 991 | 'link' => 'https://unit.test/', |
| | 992 | ], |
| | 993 | ], |
| | 994 | [ |
| | 995 | '[unittest title="unittest" link="https://unit.test/"/]', |
| | 996 | [ |
| | 997 | 'title' => 'unittest', |
| | 998 | 'link' => 'https://unit.test/', |
| | 999 | ], |
| | 1000 | ], |
| | 1001 | [ |
| | 1002 | '[unittest title="unittest" link="https://unit.test/"]Unit Test[/unittest]', |
| | 1003 | [ |
| | 1004 | 'title' => 'unittest', |
| | 1005 | 'link' => 'https://unit.test/', |
| | 1006 | ], |
| | 1007 | ], |
| | 1008 | [ |
| | 1009 | 'title="unittest" link="https://unit.test/"', |
| | 1010 | [ |
| | 1011 | 'title' => 'unittest', |
| | 1012 | 'link' => 'https://unit.test/', |
| | 1013 | ], |
| | 1014 | ], |
| | 1015 | ]; |
| | 1016 | |
| | 1017 | } |
| | 1018 | |
| | 1019 | /** |
| | 1020 | * @covers ::shortcode_parse_atts |
| | 1021 | * @dataProvider data_shortcode_parse_atts |
| | 1022 | * |
| | 1023 | * @param $shortcode |
| | 1024 | * @param $expects |
| | 1025 | */ |
| | 1026 | public function test_shortcode_parse_atts( $shortcode, $expects ) { |
| | 1027 | |
| | 1028 | $atts = shortcode_parse_atts( $shortcode ); |
| | 1029 | |
| | 1030 | $this->assertSame( $expects, $atts ); |
| | 1031 | |
| | 1032 | } |