@@ -63,11 +63,6 @@ public function set_status_test_data()
6363 */
6464 public function test_set_status ($ idea_id , $ status )
6565 {
66- $ this ->notification_manager ->expects ($ this ->once ())
67- ->method ('get_notification_type_id ' )
68- ->with (ext::NOTIFICATION_TYPE_STATUS )
69- ->willReturn (1 );
70-
7166 $ object = $ this ->get_idea_object ();
7267
7368 $ object ->set_status ($ idea_id , $ status );
@@ -77,6 +72,34 @@ public function test_set_status($idea_id, $status)
7772 self ::assertEquals ($ status , $ idea ['idea_status ' ]);
7873 }
7974
75+ public function test_set_status_notification_data ()
76+ {
77+ return [
78+ [1 , 1 , [], 'add_notifications ' ],
79+ [1 , 2 , [2 ], 'update_notifications ' ],
80+ [2 , 3 , [], 'add_notifications ' ],
81+ [2 , 4 , [3 ], 'update_notifications ' ],
82+ ];
83+ }
84+
85+ /**
86+ * @dataProvider test_set_status_notification_data
87+ */
88+ public function test_set_status_notification ($ idea_id , $ status , $ notified_users , $ expected )
89+ {
90+ $ this ->notification_manager ->expects ($ this ->once ())
91+ ->method ('get_notified_users ' )
92+ ->with (ext::NOTIFICATION_TYPE_STATUS , ['item_id ' => $ idea_id ])
93+ ->willReturn ($ notified_users );
94+
95+ $ this ->notification_manager ->expects ($ this ->once ())
96+ ->method ($ expected );
97+
98+ $ object = $ this ->get_idea_object ();
99+
100+ $ object ->set_status ($ idea_id , $ status );
101+ }
102+
80103 /**
81104 * Data for idea attribute tests
82105 *
0 commit comments