From 8f4e69cb05de8e5caeb72159c50bbd8d91283113 Mon Sep 17 00:00:00 2001 From: Thijs van der heijden Date: Thu, 19 Sep 2024 15:17:31 +0200 Subject: [PATCH] Update test. --- .../New_Dashboard_Page_Integration_Test.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/Unit/Dashboard/User_Interface/New_Dashboard_Page_Integration_Test.php b/tests/Unit/Dashboard/User_Interface/New_Dashboard_Page_Integration_Test.php index ef377978bdc..189ba56a20e 100644 --- a/tests/Unit/Dashboard/User_Interface/New_Dashboard_Page_Integration_Test.php +++ b/tests/Unit/Dashboard/User_Interface/New_Dashboard_Page_Integration_Test.php @@ -9,6 +9,7 @@ use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional; use Yoast\WP\SEO\Dashboard\User_Interface\New_Dashboard_Page_Integration; use Yoast\WP\SEO\Helpers\Current_Page_Helper; +use Yoast\WP\SEO\Helpers\Notification_Helper; use Yoast\WP\SEO\Helpers\Product_Helper; use Yoast\WP\SEO\Helpers\Short_Link_Helper; use Yoast\WP\SEO\Integrations\Academy_Integration; @@ -51,6 +52,13 @@ final class New_Dashboard_Page_Integration_Test extends TestCase { */ private $shortlink_helper; + /** + * Holds the Notification_Helper. + * + * @var Notification_Helper + */ + private $notifications_helper; + /** * The class under test. * @@ -70,12 +78,14 @@ public function set_up() { $this->current_page_helper = Mockery::mock( Current_Page_Helper::class ); $this->product_helper = Mockery::mock( Product_Helper::class ); $this->shortlink_helper = Mockery::mock( Short_Link_Helper::class ); + $this->notifications_helper = Mockery::mock( Notification_Helper::class ); $this->instance = new New_Dashboard_Page_Integration( $this->asset_manager, $this->current_page_helper, $this->product_helper, - $this->shortlink_helper + $this->shortlink_helper, + $this->notifications_helper ); } @@ -272,6 +282,16 @@ public function expect_get_script_data() { ->once() ->andReturn( $link_params ); + $this->notifications_helper + ->expects( 'get_problems' ) + ->once() + ->andReturn( [] ); + + $this->notifications_helper + ->expects( 'get_notifications' ) + ->once() + ->andReturn( [] ); + return $link_params; } }