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