Changeset 56603 for trunk/tests/phpunit/tests/admin/wpAdminNotice.php
- Timestamp:
- 09/18/2023 12:28:24 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/wpAdminNotice.php
r56408 r56603 212 212 ), 213 213 'expected' => '<div class="notice"><p>A notice with additional classes that are not an array.</p></div>', 214 ), 215 'additional attribute with a value' => array( 216 'message' => 'A notice with an additional attribute with a value.', 217 'args' => array( 218 'attributes' => array( 'aria-live' => 'assertive' ), 219 ), 220 'expected' => '<div class="notice" aria-live="assertive"><p>A notice with an additional attribute with a value.</p></div>', 221 ), 222 'additional hidden attribute' => array( 223 'message' => 'A notice with the hidden attribute.', 224 'args' => array( 225 'attributes' => array( 'hidden' => true ), 226 ), 227 'expected' => '<div class="notice" hidden><p>A notice with the hidden attribute.</p></div>', 228 ), 229 'additional attribute no associative keys' => array( 230 'message' => 'A notice with a boolean attribute without an associative key.', 231 'args' => array( 232 'attributes' => array( 'hidden' ), 233 ), 234 'expected' => '<div class="notice" hidden><p>A notice with a boolean attribute without an associative key.</p></div>', 235 ), 236 'additional attribute with role' => array( 237 'message' => 'A notice with an additional attribute role.', 238 'args' => array( 239 'attributes' => array( 'role' => 'alert' ), 240 ), 241 'expected' => '<div class="notice" role="alert"><p>A notice with an additional attribute role.</p></div>', 242 ), 243 'multiple additional attributes' => array( 244 'message' => 'A notice with multiple additional attributes.', 245 'args' => array( 246 'attributes' => array( 247 'role' => 'alert', 248 'data-test' => -1, 249 ), 250 ), 251 'expected' => '<div class="notice" role="alert" data-test="-1"><p>A notice with multiple additional attributes.</p></div>', 252 ), 253 'data attribute with unsafe value' => array( 254 'message' => 'A notice with an additional attribute with an unsafe value.', 255 'args' => array( 256 'attributes' => array( 'data-unsafe' => '<script>alert( "Howdy, admin!" );</script>' ), 257 ), 258 'expected' => '<div class="notice" data-unsafe="<script>alert( "Howdy, admin!" );</script>"><p>A notice with an additional attribute with an unsafe value.</p></div>', 259 ), 260 'additional invalid attribute' => array( 261 'message' => 'A notice with an additional attribute that is invalid.', 262 'args' => array( 263 'attributes' => array( 'not-valid' => 'not-valid' ), 264 ), 265 'expected' => '<div class="notice"><p>A notice with an additional attribute that is invalid.</p></div>', 266 ), 267 'multiple attributes with "role", invalid, data-*, numeric, and boolean' => array( 268 'message' => 'A notice with multiple attributes with "role", invalid, "data-*", numeric, and boolean.', 269 'args' => array( 270 'attributes' => array( 271 'role' => 'alert', 272 'disabled' => 'disabled', 273 'data-name' => 'my-name', 274 'data-id' => 1, 275 'hidden', 276 ), 277 ), 278 'expected' => '<div class="notice" role="alert" data-name="my-name" data-id="1" hidden><p>A notice with multiple attributes with "role", invalid, "data-*", numeric, and boolean.</p></div>', 214 279 ), 215 280 'paragraph wrapping as a falsy value rather than (bool) false' => array(
Note: See TracChangeset
for help on using the changeset viewer.