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

More tests.

parent fc92d5b3
No related branches found
No related tags found
1 merge request!3Feature/more tests
Pipeline #6886 passed with warnings
......@@ -5,6 +5,8 @@ use \WPDesk\Notice\PermanentDismissibleNotice;
class TestPermanentDismissinleNotice extends WP_UnitTestCase
{
const NOTICE_NAME = 'test_notice_name';
public function testAddAction()
{
$notice_priority = 11;
......@@ -19,6 +21,23 @@ class TestPermanentDismissinleNotice extends WP_UnitTestCase
$this->assertEquals($notice_priority, has_action('admin_notices', [$notice, 'showNotice'], $notice_priority));
}
public function testUndoDismiss()
{
update_option(PermanentDismissibleNotice::OPTION_NAME_PREFIX . self::NOTICE_NAME, PermanentDismissibleNotice::OPTION_VALUE_DISMISSED);
$notice = new PermanentDismissibleNotice(
PermanentDismissibleNotice::NOTICE_TYPE_INFO,
'test',
self::NOTICE_NAME
);
$notice->undoDismiss();
$this->assertEquals(
'',
get_option(PermanentDismissibleNotice::OPTION_NAME_PREFIX . self::NOTICE_NAME, '')
);
}
public function testShowNotice()
{
$notice = new PermanentDismissibleNotice(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment