Skip to content
Snippets Groups Projects
Commit 9a575dd7 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

HTML id for dismissible notice

parent f7587a9c
No related branches found
No related tags found
1 merge request!9Feature/wpdesk notices action
Pipeline #8577 passed
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
......@@ -66,6 +66,7 @@ class PermanentDismissibleNotice extends Notice
{
$attributesAsString = parent::getAttributesAsString();
$attributesAsString .= sprintf(' data-notice-name="%1$s"', esc_attr($this->noticeName));
$attributesAsString .= sprintf(' id="wpdesk-notice-%1$s"', esc_attr($this->noticeName));
return $attributesAsString;
}
......
......@@ -93,7 +93,7 @@ class TestFunctions extends WP_UnitTestCase
$this->assertInstanceOf(PermanentDismissibleNotice::class, $notice);
$this->expectOutputString(
'<div class="notice notice-info is-dismissible" data-notice-name="test-notice"><p>test function</p></div>'
'<div class="notice notice-info is-dismissible" data-notice-name="test-notice" id="wpdesk-notice-test-notice"><p>test function</p></div>'
);
$notice->showNotice();
......
......@@ -49,7 +49,7 @@ class TestPermanentDismissinleNotice extends WP_UnitTestCase
);
$this->expectOutputString(
'<div class="notice notice-info is-dismissible" data-notice-name="test_name"><p>test</p></div>'
'<div class="notice notice-info is-dismissible" data-notice-name="test_name" id="wpdesk-notice-test_name"><p>test</p></div>'
);
$notice->showNotice();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment