Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try/60642 fixture tests #6723

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix IDs.
  • Loading branch information
anton-vlasenko authored and Anton Vlasenko committed Jun 4, 2024
commit ebfc6be3b86638fd26f6215db9f5e43099ed15fc
3 changes: 1 addition & 2 deletions tests/phpunit/tests/rest-api/rest-schema-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,17 +762,17 @@
$datetime_keys = array( 'date', 'date_gmt', 'modified', 'modified_gmt' );

global $wpdb;
$posts = $wpdb->get_results("SELECT id, post_title, post_name as slug FROM $wpdb->posts");

Check failure on line 765 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 spaces after opening parenthesis; 0 found

Check failure on line 765 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 spaces before closing parenthesis; 0 found

//Save all titles
$post_data = array();
foreach( $posts as $post ) {

Check failure on line 769 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Space after opening control structure is required

Check failure on line 769 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

No space before opening parenthesis is prohibited

Check failure on line 769 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 space after FOREACH keyword; 0 found
$post_data[] = $post->id;
$post_data[] = $post->post_title;
$post_data[] = $post->slug;
}

$post_data = implode(',', $post_data);

Check failure on line 775 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 spaces after opening parenthesis; 0 found

Check failure on line 775 in tests/phpunit/tests/rest-api/rest-schema-setup.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 spaces before closing parenthesis; 0 found
foreach ( $data as $key => $value ) {
if ( is_string( $value ) ) {
if ( in_array( $key, $datetime_keys, true ) ) {
Expand All @@ -781,8 +781,7 @@
}

if ( 1 === preg_match( '/^post-\d+$/', $value ) ) {
// Normalize the class value to ensure test stability.
$data[ $key ] = $post_data;
$data[ $key ] = $value . '-' . $post_data;
continue;
}
}
Expand Down
Loading