| | 1 | <?php |
| | 2 | /** |
| | 3 | @group list_page |
| | 4 | */ |
| | 5 | class Tests_List_Page extends WP_UnitTestCase { |
| | 6 | var $pages; |
| | 7 | |
| | 8 | /* |
| | 9 | $defaults = array( |
| | 10 | 'depth' => 0, |
| | 11 | 'show_date' => '', |
| | 12 | 'date_format' => get_option('date_format'), |
| | 13 | 'child_of' => 0, |
| | 14 | 'exclude' => '', |
| | 15 | 'title_li' => __('Pages'), |
| | 16 | 'echo' => 1, |
| | 17 | 'authors' => '', |
| | 18 | 'sort_column' => 'menu_order, post_title', |
| | 19 | 'link_before' => '', |
| | 20 | 'link_after' => '', |
| | 21 | 'walker' => '', |
| | 22 | 'include' => '', |
| | 23 | 'post_type' => 'page', |
| | 24 | 'post_status' => 'publish', |
| | 25 | ); |
| | 26 | */ |
| | 27 | function setUp() { |
| | 28 | parent::setUp(); |
| | 29 | global $wpdb; |
| | 30 | $wpdb->query( 'TRUNCATE wptests_posts' ); |
| | 31 | $pages = array(); |
| | 32 | $this->factory->user->create( array( 'user_id' => 2 ) ); |
| | 33 | $pages[] = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 1' ) ); |
| | 34 | $pages[] = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 2' ) ); |
| | 35 | $pages[] = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'Parent 3', 'post_author' => '2' ) ); |
| | 36 | |
| | 37 | foreach ( $pages as $page ) { |
| | 38 | $this->pages[$page] = $this->factory->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 1' ) ); |
| | 39 | $this->pages[$page] = $this->factory->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 2' ) ); |
| | 40 | $this->pages[$page] = $this->factory->post->create( array( 'post_parent' => $page, 'post_type' => 'page', 'post_title' => 'Child 3' ) ); |
| | 41 | } |
| | 42 | } |
| | 43 | |
| | 44 | function test_wp_list_pages_default() { |
| | 45 | $args = array( |
| | 46 | 'echo' => false |
| | 47 | ); |
| | 48 | $expected['default'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> |
| | 49 | <ul class=\'children\'> |
| | 50 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a></li> |
| | 51 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2</a></li> |
| | 52 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3</a></li> |
| | 53 | </ul> |
| | 54 | </li> |
| | 55 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a> |
| | 56 | <ul class=\'children\'> |
| | 57 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1</a></li> |
| | 58 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2</a></li> |
| | 59 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3</a></li> |
| | 60 | </ul> |
| | 61 | </li> |
| | 62 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a> |
| | 63 | <ul class=\'children\'> |
| | 64 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">Child 1</a></li> |
| | 65 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">Child 2</a></li> |
| | 66 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">Child 3</a></li> |
| | 67 | </ul> |
| | 68 | </li> |
| | 69 | </ul></li>'; |
| | 70 | $actual = wp_list_pages( $args ); |
| | 71 | $this->AssertEquals( $expected['default'], $actual ); |
| | 72 | } |
| | 73 | |
| | 74 | function test_wp_list_pages_depth() { |
| | 75 | $args = array( |
| | 76 | 'echo' => false, |
| | 77 | 'depth' => 1 |
| | 78 | ); |
| | 79 | $expected['depth'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a></li> |
| | 80 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a></li> |
| | 81 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a></li> |
| | 82 | </ul></li>'; |
| | 83 | $actual = wp_list_pages( $args ); |
| | 84 | $this->AssertEquals( $expected['depth'], $actual ); |
| | 85 | } |
| | 86 | |
| | 87 | function test_wp_list_pages_show_date() { |
| | 88 | $args = array( |
| | 89 | 'echo' => false, |
| | 90 | 'depth' => 1, |
| | 91 | 'show_date' => true |
| | 92 | ); |
| | 93 | $expected['show_date'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> ' . date( 'F j, Y' ) . '</li> |
| | 94 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a> ' . date( 'F j, Y' ) . '</li> |
| | 95 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a> ' . date( 'F j, Y' ) . '</li> |
| | 96 | </ul></li>'; |
| | 97 | $actual = wp_list_pages( $args ); |
| | 98 | $this->AssertEquals( $expected['show_date'], $actual ); |
| | 99 | } |
| | 100 | |
| | 101 | function test_wp_list_pages_date_format() { |
| | 102 | $args = array( |
| | 103 | 'echo' => false, |
| | 104 | 'show_date' => true, |
| | 105 | 'date_format' => 'l, F j, Y' |
| | 106 | ); |
| | 107 | $expected['date_format'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> ' . date( 'l, F j, Y' ) . ' |
| | 108 | <ul class=\'children\'> |
| | 109 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 110 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 111 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 112 | </ul> |
| | 113 | </li> |
| | 114 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a> ' . date( 'l, F j, Y' ) . ' |
| | 115 | <ul class=\'children\'> |
| | 116 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 117 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 118 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 119 | </ul> |
| | 120 | </li> |
| | 121 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a> ' . date( 'l, F j, Y' ) . ' |
| | 122 | <ul class=\'children\'> |
| | 123 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">Child 1</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 124 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">Child 2</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 125 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">Child 3</a> ' . date( 'l, F j, Y' ) . '</li> |
| | 126 | </ul> |
| | 127 | </li> |
| | 128 | </ul></li>'; |
| | 129 | $actual = wp_list_pages( $args ); |
| | 130 | $this->AssertEquals( $expected['date_format'], $actual ); |
| | 131 | } |
| | 132 | |
| | 133 | function test_wp_list_pages_child_of() { |
| | 134 | $args = array( |
| | 135 | 'echo' => false, |
| | 136 | 'child_of' => 2 |
| | 137 | ); |
| | 138 | $expected['child_of'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1</a></li> |
| | 139 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2</a></li> |
| | 140 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3</a></li> |
| | 141 | </ul></li>'; |
| | 142 | $actual = wp_list_pages( $args ); |
| | 143 | $this->AssertEquals( $expected['child_of'], $actual ); |
| | 144 | } |
| | 145 | |
| | 146 | function test_wp_list_pages_exclude() { |
| | 147 | $args = array( |
| | 148 | 'echo' => false, |
| | 149 | 'exclude' => '2, 2' |
| | 150 | ); |
| | 151 | $expected['exclude'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> |
| | 152 | <ul class=\'children\'> |
| | 153 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a></li> |
| | 154 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2</a></li> |
| | 155 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3</a></li> |
| | 156 | </ul> |
| | 157 | </li> |
| | 158 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a> |
| | 159 | <ul class=\'children\'> |
| | 160 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">Child 1</a></li> |
| | 161 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">Child 2</a></li> |
| | 162 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">Child 3</a></li> |
| | 163 | </ul> |
| | 164 | </li> |
| | 165 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1</a></li> |
| | 166 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2</a></li> |
| | 167 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3</a></li> |
| | 168 | </ul></li>'; |
| | 169 | $actual = wp_list_pages( $args ); |
| | 170 | $this->AssertEquals( $expected['exclude'], $actual ); |
| | 171 | } |
| | 172 | |
| | 173 | function test_wp_list_pages_title_li() { |
| | 174 | $args = array( |
| | 175 | 'echo' => false, |
| | 176 | 'depth' => 1, |
| | 177 | 'title_li' => 'PageTitle' |
| | 178 | ); |
| | 179 | $expected['title_li'] = '<li class="pagenav">PageTitle<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a></li> |
| | 180 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a></li> |
| | 181 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a></li> |
| | 182 | </ul></li>'; |
| | 183 | $actual = wp_list_pages( $args ); |
| | 184 | $this->AssertEquals( $expected['title_li'], $actual ); |
| | 185 | } |
| | 186 | |
| | 187 | function test_wp_list_pages_echo() { |
| | 188 | $args = array( |
| | 189 | 'echo' => true, |
| | 190 | 'depth' => 1 |
| | 191 | ); |
| | 192 | $expected['echo'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a></li> |
| | 193 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a></li> |
| | 194 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a></li> |
| | 195 | </ul></li>'; |
| | 196 | ob_start(); |
| | 197 | wp_list_pages( $args ); |
| | 198 | $actual = ob_get_clean(); |
| | 199 | $this->AssertEquals( $expected['echo'], $actual ); |
| | 200 | } |
| | 201 | |
| | 202 | function test_wp_list_pages_authors() { |
| | 203 | $args = array( |
| | 204 | 'echo' => false, |
| | 205 | 'authors' => '2', |
| | 206 | ); |
| | 207 | $expected['authors'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-3"><a href="http://example.org/?page_id=3">Parent 3</a></li> |
| | 208 | </ul></li>'; |
| | 209 | $actual = wp_list_pages( $args ); |
| | 210 | $this->AssertEquals( $expected['authors'], $actual ); |
| | 211 | } |
| | 212 | |
| | 213 | function test_wp_list_pages_number() { |
| | 214 | $args = array( |
| | 215 | 'echo' => false, |
| | 216 | 'number' => 1, |
| | 217 | ); |
| | 218 | $expected['number'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a></li> |
| | 219 | </ul></li>'; |
| | 220 | $actual = wp_list_pages( $args ); |
| | 221 | $this->AssertEquals( $expected['number'], $actual ); |
| | 222 | } |
| | 223 | |
| | 224 | function test_wp_list_pages_sort_column() { |
| | 225 | $args = array( |
| | 226 | 'echo' => false, |
| | 227 | 'sort_column' => 'post_author', |
| | 228 | 'sort_order' => 'DESC' |
| | 229 | ); |
| | 230 | $expected['sort_column'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3</a> |
| | 231 | <ul class=\'children\'> |
| | 232 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">Child 1</a></li> |
| | 233 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">Child 2</a></li> |
| | 234 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">Child 3</a></li> |
| | 235 | </ul> |
| | 236 | </li> |
| | 237 | <li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> |
| | 238 | <ul class=\'children\'> |
| | 239 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a></li> |
| | 240 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2</a></li> |
| | 241 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3</a></li> |
| | 242 | </ul> |
| | 243 | </li> |
| | 244 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a> |
| | 245 | <ul class=\'children\'> |
| | 246 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1</a></li> |
| | 247 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2</a></li> |
| | 248 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3</a></li> |
| | 249 | </ul> |
| | 250 | </li> |
| | 251 | </ul></li>'; |
| | 252 | $actual = wp_list_pages( $args ); |
| | 253 | $this->AssertEquals( $expected['sort_column'], $actual ); |
| | 254 | } |
| | 255 | |
| | 256 | function test_wp_list_pages_link_before() { |
| | 257 | $args = array( |
| | 258 | 'echo' => false, |
| | 259 | 'link_before' => 'BEFORE' |
| | 260 | ); |
| | 261 | $expected['link_before'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">BEFOREParent 1</a> |
| | 262 | <ul class=\'children\'> |
| | 263 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">BEFOREChild 1</a></li> |
| | 264 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">BEFOREChild 2</a></li> |
| | 265 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">BEFOREChild 3</a></li> |
| | 266 | </ul> |
| | 267 | </li> |
| | 268 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">BEFOREParent 2</a> |
| | 269 | <ul class=\'children\'> |
| | 270 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">BEFOREChild 1</a></li> |
| | 271 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">BEFOREChild 2</a></li> |
| | 272 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">BEFOREChild 3</a></li> |
| | 273 | </ul> |
| | 274 | </li> |
| | 275 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">BEFOREParent 3</a> |
| | 276 | <ul class=\'children\'> |
| | 277 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">BEFOREChild 1</a></li> |
| | 278 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">BEFOREChild 2</a></li> |
| | 279 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">BEFOREChild 3</a></li> |
| | 280 | </ul> |
| | 281 | </li> |
| | 282 | </ul></li>'; |
| | 283 | $actual = wp_list_pages( $args ); |
| | 284 | $this->AssertEquals( $expected['link_before'], $actual ); |
| | 285 | } |
| | 286 | |
| | 287 | function test_wp_list_pages_link_after() { |
| | 288 | $args = array( |
| | 289 | 'echo' => false, |
| | 290 | 'link_after' => 'AFTER' |
| | 291 | ); |
| | 292 | $expected['link_after'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1AFTER</a> |
| | 293 | <ul class=\'children\'> |
| | 294 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1AFTER</a></li> |
| | 295 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2AFTER</a></li> |
| | 296 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3AFTER</a></li> |
| | 297 | </ul> |
| | 298 | </li> |
| | 299 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2AFTER</a> |
| | 300 | <ul class=\'children\'> |
| | 301 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1AFTER</a></li> |
| | 302 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2AFTER</a></li> |
| | 303 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3AFTER</a></li> |
| | 304 | </ul> |
| | 305 | </li> |
| | 306 | <li class="page_item page-item-3 page_item_has_children"><a href="http://example.org/?page_id=3">Parent 3AFTER</a> |
| | 307 | <ul class=\'children\'> |
| | 308 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">Child 1AFTER</a></li> |
| | 309 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">Child 2AFTER</a></li> |
| | 310 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">Child 3AFTER</a></li> |
| | 311 | </ul> |
| | 312 | </li> |
| | 313 | </ul></li>'; |
| | 314 | $actual = wp_list_pages( $args ); |
| | 315 | $this->AssertEquals( $expected['link_after'], $actual ); |
| | 316 | } |
| | 317 | |
| | 318 | |
| | 319 | function test_wp_list_pages_include() { |
| | 320 | $args = array( |
| | 321 | 'echo' => false, |
| | 322 | 'include' => '1,3' |
| | 323 | ); |
| | 324 | $expected['include'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1"><a href="http://example.org/?page_id=1">Parent 1</a></li> |
| | 325 | <li class="page_item page-item-3"><a href="http://example.org/?page_id=3">Parent 3</a></li> |
| | 326 | </ul></li>'; |
| | 327 | $actual = wp_list_pages( $args ); |
| | 328 | $this->AssertEquals( $expected['include'], $actual ); |
| | 329 | } |
| | 330 | |
| | 331 | function test_wp_list_pages_exclude_tree() { |
| | 332 | $args = array( |
| | 333 | 'echo' => false, |
| | 334 | 'exclude_tree' => '2, 3' |
| | 335 | ); |
| | 336 | $expected['exclude'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> |
| | 337 | <ul class=\'children\'> |
| | 338 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a></li> |
| | 339 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2</a></li> |
| | 340 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3</a></li> |
| | 341 | </ul> |
| | 342 | </li> |
| | 343 | </ul></li>'; |
| | 344 | $actual = wp_list_pages( $args ); |
| | 345 | $this->AssertEquals( $expected['exclude'], $actual ); |
| | 346 | } |
| | 347 | |
| | 348 | /** |
| | 349 | * @ticket 27326 |
| | 350 | */ |
| | 351 | function test_wp_list_page_combo_exclude_depth() { |
| | 352 | $args = array( |
| | 353 | 'echo' => false, |
| | 354 | 'exclude' => '3', |
| | 355 | 'depth' => 3 |
| | 356 | ); |
| | 357 | $expected['exclude_depth'] = '<li class="pagenav">Pages<ul><li class="page_item page-item-1 page_item_has_children"><a href="http://example.org/?page_id=1">Parent 1</a> |
| | 358 | <ul class=\'children\'> |
| | 359 | <li class="page_item page-item-4"><a href="http://example.org/?page_id=4">Child 1</a></li> |
| | 360 | <li class="page_item page-item-5"><a href="http://example.org/?page_id=5">Child 2</a></li> |
| | 361 | <li class="page_item page-item-6"><a href="http://example.org/?page_id=6">Child 3</a></li> |
| | 362 | </ul> |
| | 363 | </li> |
| | 364 | <li class="page_item page-item-2 page_item_has_children"><a href="http://example.org/?page_id=2">Parent 2</a> |
| | 365 | <ul class=\'children\'> |
| | 366 | <li class="page_item page-item-7"><a href="http://example.org/?page_id=7">Child 1</a></li> |
| | 367 | <li class="page_item page-item-8"><a href="http://example.org/?page_id=8">Child 2</a></li> |
| | 368 | <li class="page_item page-item-9"><a href="http://example.org/?page_id=9">Child 3</a></li> |
| | 369 | </ul> |
| | 370 | </li> |
| | 371 | <li class="page_item page-item-10"><a href="http://example.org/?page_id=10">Child 1</a></li> |
| | 372 | <li class="page_item page-item-11"><a href="http://example.org/?page_id=11">Child 2</a></li> |
| | 373 | <li class="page_item page-item-12"><a href="http://example.org/?page_id=12">Child 3</a></li> |
| | 374 | </ul></li>'; |
| | 375 | $actual = wp_list_pages( $args ); |
| | 376 | $this->AssertEquals( $expected['exclude_depth'], $actual ); |
| | 377 | } |
| | 378 | |
| | 379 | } |