Skip to content

Commit a4718ab

Browse files
authored
Fix PHPCS errors in Behat test files (#13)
1 parent 114d074 commit a4718ab

2 files changed

Lines changed: 620 additions & 410 deletions

File tree

‎features/ability-category.feature‎

Lines changed: 68 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,26 @@ Feature: Manage ability categories registered via the WordPress Abilities API.
1616
Given a wp-content/mu-plugins/test-ability.php file:
1717
"""
1818
<?php
19-
add_action( 'wp_abilities_api_categories_init', function() {
20-
wp_register_ability_category( 'content', array(
21-
'label' => 'Content',
22-
'description' => 'Content management abilities.',
23-
) );
24-
25-
wp_register_ability_category( 'ai', array(
26-
'label' => 'AI',
27-
'description' => 'AI-powered abilities.',
28-
) );
29-
} );
19+
add_action(
20+
'wp_abilities_api_categories_init',
21+
function () {
22+
wp_register_ability_category(
23+
'content',
24+
array(
25+
'label' => 'Content',
26+
'description' => 'Content management abilities.',
27+
)
28+
);
29+
30+
wp_register_ability_category(
31+
'ai',
32+
array(
33+
'label' => 'AI',
34+
'description' => 'AI-powered abilities.',
35+
)
36+
);
37+
}
38+
);
3039
"""
3140

3241
When I run `wp ability category list`
@@ -56,12 +65,18 @@ Feature: Manage ability categories registered via the WordPress Abilities API.
5665
Given a wp-content/mu-plugins/test-ability.php file:
5766
"""
5867
<?php
59-
add_action( 'wp_abilities_api_categories_init', function() {
60-
wp_register_ability_category( 'content', array(
61-
'label' => 'Content',
62-
'description' => 'Content management abilities.',
63-
) );
64-
} );
68+
add_action(
69+
'wp_abilities_api_categories_init',
70+
function () {
71+
wp_register_ability_category(
72+
'content',
73+
array(
74+
'label' => 'Content',
75+
'description' => 'Content management abilities.',
76+
)
77+
);
78+
}
79+
);
6580
"""
6681

6782
When I run `wp ability category get content`
@@ -94,12 +109,18 @@ Feature: Manage ability categories registered via the WordPress Abilities API.
94109
Given a wp-content/mu-plugins/test-ability.php file:
95110
"""
96111
<?php
97-
add_action( 'wp_abilities_api_categories_init', function() {
98-
wp_register_ability_category( 'content', array(
99-
'label' => 'Content',
100-
'description' => 'Content management abilities.',
101-
) );
102-
} );
112+
add_action(
113+
'wp_abilities_api_categories_init',
114+
function () {
115+
wp_register_ability_category(
116+
'content',
117+
array(
118+
'label' => 'Content',
119+
'description' => 'Content management abilities.',
120+
)
121+
);
122+
}
123+
);
103124
"""
104125

105126
When I run `wp ability category exists content`
@@ -113,21 +134,30 @@ Feature: Manage ability categories registered via the WordPress Abilities API.
113134
Given a wp-content/mu-plugins/test-ability.php file:
114135
"""
115136
<?php
116-
add_action( 'wp_abilities_api_categories_init', function() {
117-
wp_register_ability_category( 'custom-meta', array(
118-
'label' => 'Custom Meta Category',
119-
'description' => 'A category with custom meta.',
120-
'meta' => array(
121-
'custom_key' => 'custom_value',
122-
'version' => '1.0',
123-
),
124-
) );
125-
126-
wp_register_ability_category( 'no-meta', array(
127-
'label' => 'No Meta Category',
128-
'description' => 'A category without custom meta.',
129-
) );
130-
} );
137+
add_action(
138+
'wp_abilities_api_categories_init',
139+
function () {
140+
wp_register_ability_category(
141+
'custom-meta',
142+
array(
143+
'label' => 'Custom Meta Category',
144+
'description' => 'A category with custom meta.',
145+
'meta' => array(
146+
'custom_key' => 'custom_value',
147+
'version' => '1.0',
148+
),
149+
)
150+
);
151+
152+
wp_register_ability_category(
153+
'no-meta',
154+
array(
155+
'label' => 'No Meta Category',
156+
'description' => 'A category without custom meta.',
157+
)
158+
);
159+
}
160+
);
131161
"""
132162

133163
When I run `wp ability category get custom-meta --format=json`

0 commit comments

Comments
 (0)