Skip to content

Commit 6b1f014

Browse files
authored
Merge pull request #2242 from WordPress/dependabot/npm_and_yarn/commander-14.0.2
Bump commander from 14.0.1 to 14.0.2
2 parents 22ec22f + ca797bf commit 6b1f014

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@wordpress/env": "^10.33.0",
1919
"@wordpress/prettier-config": "^4.33.0",
2020
"@wordpress/scripts": "^30.26.0",
21-
"commander": "14.0.1",
21+
"commander": "14.0.2",
2222
"copy-webpack-plugin": "^13.0.1",
2323
"css-minimizer-webpack-plugin": "^7.0.2",
2424
"fast-glob": "^3.3.3",

plugins/optimization-detective/tests/storage/test-class-od-rest-url-metrics-store-endpoint.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@
1616
class Test_OD_REST_URL_Metrics_Store_Endpoint extends WP_UnitTestCase {
1717
use Optimization_Detective_Test_Helpers;
1818

19+
/**
20+
* @var array<string, WP_Post_Type>|null
21+
*/
22+
protected $original_post_types = null;
23+
1924
/**
2025
* Sets up.
2126
*/
2227
public function set_up(): void {
2328
parent::set_up();
2429
unset( $GLOBALS['wp_rest_server'] );
30+
31+
// This is needed due to how create_initial_rest_routes() was modified in <https://core.trac.wordpress.org/changeset/61029>. See <https://core.trac.wordpress.org/ticket/62755#comment:21>.
32+
global $wp_post_types;
33+
$this->original_post_types = $wp_post_types;
2534
}
2635

2736
/**
@@ -30,6 +39,9 @@ public function set_up(): void {
3039
public function tear_down(): void {
3140
parent::tear_down();
3241
unset( $GLOBALS['wp_rest_server'] );
42+
43+
global $wp_post_types;
44+
$wp_post_types = $this->original_post_types;
3345
}
3446

3547
/**

plugins/optimization-detective/tests/storage/test-class-od-url-metrics-post-type.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,15 @@ public function test_delete_all_posts(): void {
412412
// Create sample posts of all post types other than URL Metrics.
413413
$other_post_ids = array();
414414
foreach ( array_diff( get_post_types(), array( OD_URL_Metrics_Post_Type::SLUG ) ) as $post_type ) {
415-
$other_post_ids = array_merge(
416-
$other_post_ids,
417-
self::factory()->post->create_many( 10, compact( 'post_type' ) )
418-
);
415+
for ( $i = 0; $i < 10; $i++ ) {
416+
$other_post = self::factory()->post->create_and_get( compact( 'post_type' ) );
417+
$this->assertInstanceOf(
418+
WP_Post::class,
419+
$other_post,
420+
"Failed to create post of $post_type post type: " . ( $other_post instanceof WP_Error ? $other_post->get_error_message() : 'Unknown' )
421+
);
422+
$other_post_ids[] = $other_post->ID;
423+
}
419424
}
420425
foreach ( $other_post_ids as $post_id ) {
421426
update_post_meta( $post_id, $other_post_meta_key, $other_post_meta_value );

0 commit comments

Comments
 (0)