Changeset 48937 for trunk/tests/phpunit/tests/walker.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/walker.php
r47122 r48937 27 27 $output = $this->walker->walk( $items, 0 ); 28 28 29 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );30 $this->assert Equals( '<li>1</li>', $output );29 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 30 $this->assertSame( '<li>1</li>', $output ); 31 31 32 32 } … … 42 42 $output = $this->walker->walk( $items, -1 ); 43 43 44 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );45 $this->assert Equals( '<li>1</li>', $output );44 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 45 $this->assertSame( '<li>1</li>', $output ); 46 46 47 47 } … … 57 57 $output = $this->walker->walk( $items, 1 ); 58 58 59 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );60 $this->assert Equals( '<li>1</li>', $output );59 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 60 $this->assertSame( '<li>1</li>', $output ); 61 61 62 62 } … … 77 77 $output = $this->walker->walk( $items, 0 ); 78 78 79 $this->assert Equals( 2, $this->walker->get_number_of_root_elements( $items ) );80 $this->assert Equals( '<li>1</li><li>2</li>', $output );79 $this->assertSame( 2, $this->walker->get_number_of_root_elements( $items ) ); 80 $this->assertSame( '<li>1</li><li>2</li>', $output ); 81 81 82 82 } … … 97 97 $output = $this->walker->walk( $items, 0 ); 98 98 99 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );100 $this->assert Equals( '<li>1<ul><li>2</li></ul></li>', $output );99 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 100 $this->assertSame( '<li>1<ul><li>2</li></ul></li>', $output ); 101 101 102 102 } … … 117 117 $output = $this->walker->walk( $items, -1 ); 118 118 119 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );120 $this->assert Equals( '<li>1</li><li>2</li>', $output );119 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 120 $this->assertSame( '<li>1</li><li>2</li>', $output ); 121 121 122 122 } … … 137 137 $output = $this->walker->walk( $items, 1 ); 138 138 139 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );140 $this->assert Equals( '<li>1</li>', $output );139 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 140 $this->assertSame( '<li>1</li>', $output ); 141 141 142 142 } … … 161 161 $output = $this->walker->walk( $items, 2 ); 162 162 163 $this->assert Equals( 1, $this->walker->get_number_of_root_elements( $items ) );164 $this->assert Equals( '<li>1<ul><li>2</li></ul></li>', $output );163 $this->assertSame( 1, $this->walker->get_number_of_root_elements( $items ) ); 164 $this->assertSame( '<li>1<ul><li>2</li></ul></li>', $output ); 165 165 166 166 } … … 181 181 $output = $this->walker->walk( $items, 0 ); 182 182 183 $this->assert Equals( 0, $this->walker->get_number_of_root_elements( $items ) );184 $this->assert Equals( '<li>1<ul><li>2</li></ul></li>', $output );183 $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) ); 184 $this->assertSame( '<li>1<ul><li>2</li></ul></li>', $output ); 185 185 186 186 } … … 197 197 $output = $this->walker->walk( $items, 0 ); 198 198 199 $this->assert Equals( 0, $this->walker->get_number_of_root_elements( $items ) );200 $this->assert Equals( '<li>1</li>', $output );199 $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) ); 200 $this->assertSame( '<li>1</li>', $output ); 201 201 202 202 } … … 213 213 $output = $this->walker->walk( $items, 1 ); 214 214 215 $this->assert Equals( 0, $this->walker->get_number_of_root_elements( $items ) );215 $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) ); 216 216 217 217 // It's not clear what the output of this "should" be. 218 218 219 219 // Currently the item is simply returned. 220 $this->assert Equals( '<li>1</li>', $output );220 $this->assertSame( '<li>1</li>', $output ); 221 221 222 222 // But as we've only asked for the first depth maybe nothing should be returned? 223 // $this->assert Equals( '', $output );223 // $this->assertSame( '', $output ); 224 224 225 225 } … … 244 244 $output = $this->walker->walk( $items, 0 ); 245 245 246 $this->assert Equals( 0, $this->walker->get_number_of_root_elements( $items ) );247 $this->assert Equals( '<li>4</li><li>5</li><li>6</li>', $output );246 $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) ); 247 $this->assertSame( '<li>4</li><li>5</li><li>6</li>', $output ); 248 248 249 249 } … … 268 268 $output = $this->walker->walk( $items, 1 ); 269 269 270 $this->assert Equals( 0, $this->walker->get_number_of_root_elements( $items ) );270 $this->assertSame( 0, $this->walker->get_number_of_root_elements( $items ) ); 271 271 272 272 // It's not clear what the output of this "should" be. 273 273 274 274 // Currently the first item is simply returned. 275 $this->assert Equals( '<li>4</li>', $output );275 $this->assertSame( '<li>4</li>', $output ); 276 276 277 277 // But as we've only asked for the first depth maybe nothing should be returned? 278 // $this->assert Equals( '', $output );278 // $this->assertSame( '', $output ); 279 279 280 280 // Or maybe all items which are missing parents should simply be treat top level? 281 // $this->assert Equals( '<li>4</li><li>5</li><li>6</li>', $output );281 // $this->assertSame( '<li>4</li><li>5</li><li>6</li>', $output ); 282 282 283 283 }
Note: See TracChangeset
for help on using the changeset viewer.