From 007ca4bfbf012ab3a2e7d161e0c7eca2326be410 Mon Sep 17 00:00:00 2001 From: Ben Ritner Date: Tue, 3 Dec 2024 16:11:27 -0700 Subject: [PATCH] Add test --- tests/wpunit/Admin/NoticeTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/wpunit/Admin/NoticeTest.php b/tests/wpunit/Admin/NoticeTest.php index 048adba8..1963f940 100644 --- a/tests/wpunit/Admin/NoticeTest.php +++ b/tests/wpunit/Admin/NoticeTest.php @@ -4,6 +4,7 @@ use StellarWP\Uplink\Admin\Notice; use StellarWP\Uplink\Tests\UplinkTestCase; +use StellarWP\Uplink\Config; class NoticeTest extends UplinkTestCase { @@ -24,4 +25,14 @@ public function test_it_should_display_notice() { $notice->setup_notices(); } + public function test_it_should_display_notice_with_link() { + Config::set_hook_prefix( 'events-calendar-pro' ); + $notice = new Notice(); + $notice->add_notice( Notice::EXPIRED_KEY, 'uplink' ); + + $this->expectOutputString( '

Your license is expired Renew Your License Now (opens in a new window)

' ); + + $notice->setup_notices(); + } + }