File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
tests/integration/notifications Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 12
12
*/
13
13
class Yoast_Notification_Test extends WPSEO_UnitTestCase {
14
14
15
+ /**
16
+ * User ID.
17
+ *
18
+ * @var int
19
+ */
20
+ private $ user_id ;
21
+
15
22
/**
16
23
* Test capability filters get set.
17
24
*
@@ -26,6 +33,20 @@ class Yoast_Notification_Test extends WPSEO_UnitTestCase {
26
33
*/
27
34
private $ verify_capability_match_filter_args = [];
28
35
36
+ /**
37
+ * Create user with proper caps.
38
+ */
39
+ public function set_up () {
40
+ parent ::set_up ();
41
+
42
+ $ this ->user_id = $ this ->factory ->user ->create ();
43
+
44
+ $ user = new WP_User ( $ this ->user_id );
45
+ $ user ->add_cap ( 'wpseo_manage_options ' );
46
+
47
+ wp_set_current_user ( $ this ->user_id );
48
+ }
49
+
29
50
/**
30
51
* No ID is not persistent.
31
52
*/
You can’t perform that action at this time.
0 commit comments