Skip to content

Commit 89ab326

Browse files
committed
Debug
1 parent 2524386 commit 89ab326

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/workflows/phpunit-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
secrets: inherit
7070
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
7171
strategy:
72-
fail-fast: false
72+
fail-fast: true
7373
matrix:
7474
event: ['${{ github.event_name }}']
7575
os: [ ubuntu-24.04 ]
@@ -205,7 +205,7 @@ jobs:
205205
secrets: inherit
206206
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
207207
strategy:
208-
fail-fast: false
208+
fail-fast: true
209209
matrix:
210210
event: ['${{ github.event_name }}']
211211
os: [ ubuntu-24.04 ]
@@ -428,7 +428,7 @@ jobs:
428428
secrets: inherit
429429
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
430430
strategy:
431-
fail-fast: false
431+
fail-fast: true
432432
matrix:
433433
event: ['${{ github.event_name }}']
434434
os: [ ubuntu-24.04 ]
@@ -495,7 +495,7 @@ jobs:
495495
secrets: inherit
496496
if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
497497
strategy:
498-
fail-fast: false
498+
fail-fast: true
499499
matrix:
500500
php: [ '7.2', '7.4', '8.0', '8.4' ]
501501
db-type: [ 'mysql' ]
@@ -524,7 +524,7 @@ jobs:
524524
secrets: inherit
525525
if: ${{ ! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request' }}
526526
strategy:
527-
fail-fast: false
527+
fail-fast: true
528528
matrix:
529529
php: [ '7.2', '8.4' ]
530530
db-version: [ '8.4', '11.8' ]

src/wp-includes/class-wp-block.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,9 @@ public function render( $options = array() ) {
628628
*/
629629
if ( ( ! empty( $this->block_type->style_handles ) ) ) {
630630
foreach ( $this->block_type->style_handles as $style_handle ) {
631+
if ( ! empty( $GLOBALS['debug_on_demand_block_style'] ) ) {
632+
error_log( __FILE__ . ':' . __LINE__ . ' enqueue: ' . json_encode( $style_handle ) );
633+
}
631634
wp_enqueue_style( $style_handle );
632635
}
633636
}
@@ -675,6 +678,9 @@ public function render( $options = array() ) {
675678
$after_styles_queue = wp_styles()->queue;
676679
$after_scripts_queue = wp_scripts()->queue;
677680
$after_script_modules_queue = wp_script_modules()->get_queue();
681+
if ( ! empty( $GLOBALS['debug_on_demand_block_style'] ) ) {
682+
error_log( __FILE__ . ':' . __LINE__ . ' $after_styles_queue: ' . json_encode( $after_styles_queue ) );
683+
}
678684

679685
/*
680686
* As a very special case, a dynamic block may in fact include a call to wp_head() (and thus wp_enqueue_scripts()),

tests/phpunit/tests/template.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,8 @@ function (): void {
16471647
* @dataProvider data_wp_hoist_late_printed_styles
16481648
*/
16491649
public function test_wp_hoist_late_printed_styles( ?Closure $set_up, int $inline_size_limit, array $expected_styles ): void {
1650+
$GLOBALS['debug_on_demand_block_style'] = true; // TODO: Remove.
1651+
16501652
switch_theme( 'default' );
16511653
global $wp_styles;
16521654
$wp_styles = null;
@@ -1674,6 +1676,7 @@ static function () {
16741676

16751677
// Ensure that separate core block assets get registered.
16761678
register_core_block_style_handles();
1679+
$this->assertTrue( WP_Block_Type_Registry::get_instance()->is_registered( 'core/separator' ), 'Expected the core/separator block to be registered.' );
16771680
if ( wp_should_load_separate_core_block_assets() ) {
16781681
$this->assertTrue( wp_style_is( 'wp-block-separator', 'registered' ), 'Expected the wp-block-separator style to be registered.' );
16791682
}
@@ -1757,6 +1760,8 @@ static function () {
17571760
$found_subset_styles,
17581761
'Expected the same styles. Snapshot: ' . self::get_array_snapshot_export( $found_styles )
17591762
);
1763+
1764+
unset( $GLOBALS['debug_on_demand_block_style'] ); // TODO: Remove.
17601765
}
17611766

17621767
public function assertTemplateHierarchy( $url, array $expected, $message = '' ) {

0 commit comments

Comments
 (0)