Skip to content

Commit 5dce48b

Browse files
authored
Fix PHPCS errors in Behat test files (#652)
1 parent e94a23c commit 5dce48b

6 files changed

Lines changed: 85 additions & 85 deletions

File tree

‎features/icon-collection.feature‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,24 @@ Feature: Manage WordPress icon collections
7171
<?php
7272
// Plugin Name: Test Icons
7373
add_action(
74-
'init',
75-
function () {
76-
wp_register_icon_collection(
77-
'test-icons',
78-
array(
79-
'label' => 'Test Icons',
80-
'description' => 'A collection for testing.',
81-
)
82-
);
83-
84-
wp_register_icon(
85-
'test-icons/square',
86-
array(
87-
'label' => 'Square',
88-
'content' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16v16H4z" /></svg>',
89-
)
90-
);
91-
}
74+
'init',
75+
function () {
76+
wp_register_icon_collection(
77+
'test-icons',
78+
array(
79+
'label' => 'Test Icons',
80+
'description' => 'A collection for testing.',
81+
)
82+
);
83+
84+
wp_register_icon(
85+
'test-icons/square',
86+
array(
87+
'label' => 'Square',
88+
'content' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16v16H4z" /></svg>',
89+
)
90+
);
91+
}
9292
);
9393
"""
9494

‎features/icon.feature‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,24 +151,24 @@ Feature: Manage WordPress SVG icons
151151
<?php
152152
// Plugin Name: Test Icons
153153
add_action(
154-
'init',
155-
function () {
156-
wp_register_icon_collection(
157-
'test-icons',
158-
array(
159-
'label' => 'Test Icons',
160-
'description' => 'A collection for testing.',
161-
)
162-
);
163-
164-
wp_register_icon(
165-
'test-icons/square',
166-
array(
167-
'label' => 'Square',
168-
'content' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16v16H4z" /></svg>',
169-
)
170-
);
171-
}
154+
'init',
155+
function () {
156+
wp_register_icon_collection(
157+
'test-icons',
158+
array(
159+
'label' => 'Test Icons',
160+
'description' => 'A collection for testing.',
161+
)
162+
);
163+
164+
wp_register_icon(
165+
'test-icons/square',
166+
array(
167+
'label' => 'Square',
168+
'content' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16v16H4z" /></svg>',
169+
)
170+
);
171+
}
172172
);
173173
"""
174174

‎features/post-block.feature‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -587,20 +587,20 @@ Feature: Manage blocks in post content
587587
"""
588588
<?php
589589
WP_CLI::add_wp_hook(
590-
'wp_cli_post_block_update_html',
591-
function ( $block, $new_attrs, $block_name ) {
592-
if ( 'core/paragraph' === $block_name && isset( $new_attrs['customClass'] ) ) {
593-
$block['innerHTML'] = preg_replace(
594-
'/<p([^>]*)>/',
595-
'<p class="' . esc_attr( $new_attrs['customClass'] ) . '"$1>',
596-
$block['innerHTML']
597-
);
598-
$block['innerContent'] = [ $block['innerHTML'] ];
599-
}
600-
return $block;
601-
},
602-
10,
603-
3
590+
'wp_cli_post_block_update_html',
591+
function ( $block, $new_attrs, $block_name ) {
592+
if ( 'core/paragraph' === $block_name && isset( $new_attrs['customClass'] ) ) {
593+
$block['innerHTML'] = preg_replace(
594+
'/<p([^>]*)>/',
595+
'<p class="' . esc_attr( $new_attrs['customClass'] ) . '"$1>',
596+
$block['innerHTML']
597+
);
598+
$block['innerContent'] = [ $block['innerHTML'] ];
599+
}
600+
return $block;
601+
},
602+
10,
603+
3
604604
);
605605
"""
606606
When I run `wp post create --post_title="Block Post" --post_content="<!-- wp:paragraph --><p>Hello World</p><!-- /wp:paragraph -->" --porcelain`

‎features/taxonomy.feature‎

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ Feature: Manage WordPress taxonomies
5555
<?php
5656
// Plugin Name: Test Taxonomy Strict/No-Strict Mode
5757
add_action(
58-
'init',
59-
function () {
60-
$args = array(
61-
'hierarchical' => true,
62-
'show_ui' => true,
63-
'show_admin_column' => true,
64-
'update_count_callback' => '_update_post_term_count',
65-
'query_var' => true,
66-
'labels' => array(
67-
'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
68-
),
69-
);
70-
register_taxonomy( 'genres', array( 'post', 'page' ), $args );
71-
}
58+
'init',
59+
function () {
60+
$args = array(
61+
'hierarchical' => true,
62+
'show_ui' => true,
63+
'show_admin_column' => true,
64+
'update_count_callback' => '_update_post_term_count',
65+
'query_var' => true,
66+
'labels' => array(
67+
'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
68+
),
69+
);
70+
register_taxonomy( 'genres', array( 'post', 'page' ), $args );
71+
}
7272
);
7373
"""
7474

@@ -95,20 +95,20 @@ Feature: Manage WordPress taxonomies
9595
<?php
9696
// Plugin Name: Test Taxonomy Strict/No-Strict Mode
9797
add_action(
98-
'init',
99-
function () {
100-
$args = array(
101-
'hierarchical' => true,
102-
'show_ui' => true,
103-
'show_admin_column' => true,
104-
'update_count_callback' => '_update_post_term_count',
105-
'query_var' => true,
106-
'labels' => array(
107-
'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
108-
),
109-
);
110-
register_taxonomy( 'genres', array( 'post', 'page' ), $args );
111-
}
98+
'init',
99+
function () {
100+
$args = array(
101+
'hierarchical' => true,
102+
'show_ui' => true,
103+
'show_admin_column' => true,
104+
'update_count_callback' => '_update_post_term_count',
105+
'query_var' => true,
106+
'labels' => array(
107+
'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
108+
),
109+
);
110+
register_taxonomy( 'genres', array( 'post', 'page' ), $args );
111+
}
112112
);
113113
"""
114114

‎features/term-migrate.feature‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ Feature: Migrate term custom fields
9696
<?php
9797
// Plugin Name: Test Migrate
9898
add_action(
99-
'init',
100-
function () {
101-
register_post_type( 'news', [ 'public' => true ] );
102-
register_taxonomy( 'topic', 'news', [ 'public' => true ] );
103-
}
99+
'init',
100+
function () {
101+
register_post_type( 'news', [ 'public' => true ] );
102+
register_taxonomy( 'topic', 'news', [ 'public' => true ] );
103+
}
104104
);
105105
"""
106106

‎features/user-term.feature‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Feature: Manage user term
77
<?php
88
// Plugin Name: Test Add Tax
99
function add_cli_tax() {
10-
register_taxonomy( 'user_type', 'user' );
10+
register_taxonomy( 'user_type', 'user' );
1111
}
1212
add_action( 'init', 'add_cli_tax' );
1313
"""
@@ -74,7 +74,7 @@ Feature: Manage user term
7474
<?php
7575
// Plugin Name: Test Add Tax
7676
function add_cli_tax() {
77-
register_taxonomy( 'user_type', 'user' );
77+
register_taxonomy( 'user_type', 'user' );
7878
}
7979
add_action( 'init', 'add_cli_tax' );
8080
"""

0 commit comments

Comments
 (0)