Changeset 61111 for trunk/tests/phpunit/tests/template.php
- Timestamp:
- 11/01/2025 04:44:21 AM (5 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/template.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/template.php
r61088 r61111 647 647 $mock_action_callback = new MockAction(); 648 648 add_filter( 649 'wp_ send_late_headers',649 'wp_finalized_template_enhancement_output_buffer', 650 650 array( $mock_action_callback, 'action' ), 651 651 10, … … 734 734 $this->assertStringContainsString( '</html>', $processed_output, 'Expected processed output to contain string.' ); 735 735 736 $this->assertSame( 1, did_action( 'wp_ send_late_headers' ), 'Expected the wp_send_late_headersaction to have fired.' );737 $this->assertSame( 1, $mock_action_callback->get_call_count(), 'Expected wp_ send_late_headersaction callback to have been called once.' );736 $this->assertSame( 1, did_action( 'wp_finalized_template_enhancement_output_buffer' ), 'Expected the wp_finalized_template_enhancement_output_buffer action to have fired.' ); 737 $this->assertSame( 1, $mock_action_callback->get_call_count(), 'Expected wp_finalized_template_enhancement_output_buffer action callback to have been called once.' ); 738 738 $action_args = $mock_action_callback->get_args()[0]; 739 $this->assertCount( 1, $action_args, 'Expected the wp_ send_late_headersaction to have been passed only one argument.' );740 $this->assertSame( $processed_output, $action_args[0], 'Expected the arg passed to wp_ send_late_headersto be the same as the processed output buffer.' );739 $this->assertCount( 1, $action_args, 'Expected the wp_finalized_template_enhancement_output_buffer action to have been passed only one argument.' ); 740 $this->assertSame( $processed_output, $action_args[0], 'Expected the arg passed to wp_finalized_template_enhancement_output_buffer to be the same as the processed output buffer.' ); 741 741 } 742 742 … … 773 773 $mock_action_callback = new MockAction(); 774 774 add_filter( 775 'wp_ send_late_headers',775 'wp_finalized_template_enhancement_output_buffer', 776 776 array( $mock_action_callback, 'action' ), 777 777 10, … … 819 819 $this->assertStringContainsString( '<title>Output Buffer Not Processed</title>', $output, 'Expected output buffer to have string since the output buffer was ended with cleaning.' ); 820 820 821 $this->assertSame( 0, did_action( 'wp_ send_late_headers' ), 'Expected the wp_send_late_headersaction to not have fired.' );822 $this->assertSame( 0, $mock_action_callback->get_call_count(), 'Expected wp_ send_late_headersaction callback to have been called once.' );821 $this->assertSame( 0, did_action( 'wp_finalized_template_enhancement_output_buffer' ), 'Expected the wp_finalized_template_enhancement_output_buffer action to not have fired.' ); 822 $this->assertSame( 0, $mock_action_callback->get_call_count(), 'Expected wp_finalized_template_enhancement_output_buffer action callback to have been called once.' ); 823 823 } 824 824 … … 855 855 $mock_action_callback = new MockAction(); 856 856 add_filter( 857 'wp_ send_late_headers',857 'wp_finalized_template_enhancement_output_buffer', 858 858 array( $mock_action_callback, 'action' ), 859 859 10, … … 906 906 $this->assertStringContainsString( '<h1>Template Replaced</h1>', $output, 'Expected output buffer to have string due to replaced template.' ); 907 907 908 $this->assertSame( 1, did_action( 'wp_ send_late_headers' ), 'Expected the wp_send_late_headersaction to have fired.' );909 $this->assertSame( 1, $mock_action_callback->get_call_count(), 'Expected wp_ send_late_headersaction callback to have been called once.' );908 $this->assertSame( 1, did_action( 'wp_finalized_template_enhancement_output_buffer' ), 'Expected the wp_finalized_template_enhancement_output_buffer action to have fired.' ); 909 $this->assertSame( 1, $mock_action_callback->get_call_count(), 'Expected wp_finalized_template_enhancement_output_buffer action callback to have been called once.' ); 910 910 $action_args = $mock_action_callback->get_args()[0]; 911 $this->assertCount( 1, $action_args, 'Expected the wp_ send_late_headersaction to have been passed only one argument.' );912 $this->assertSame( $output, $action_args[0], 'Expected the arg passed to wp_ send_late_headersto be the same as the processed output buffer.' );911 $this->assertCount( 1, $action_args, 'Expected the wp_finalized_template_enhancement_output_buffer action to have been passed only one argument.' ); 912 $this->assertSame( $output, $action_args[0], 'Expected the arg passed to wp_finalized_template_enhancement_output_buffer to be the same as the processed output buffer.' ); 913 913 } 914 914 … … 931 931 $mock_action_callback = new MockAction(); 932 932 add_filter( 933 'wp_ send_late_headers',933 'wp_finalized_template_enhancement_output_buffer', 934 934 array( $mock_action_callback, 'action' ), 935 935 10, … … 971 971 $this->assertSame( $json, $output, 'Expected output to not be processed.' ); 972 972 973 $this->assertSame( 1, did_action( 'wp_ send_late_headers' ), 'Expected the wp_send_late_headersaction to have fired even though the wp_template_enhancement_output_buffer filter did not apply.' );974 $this->assertSame( 1, $mock_action_callback->get_call_count(), 'Expected wp_ send_late_headersaction callback to have been called once.' );973 $this->assertSame( 1, did_action( 'wp_finalized_template_enhancement_output_buffer' ), 'Expected the wp_finalized_template_enhancement_output_buffer action to have fired even though the wp_template_enhancement_output_buffer filter did not apply.' ); 974 $this->assertSame( 1, $mock_action_callback->get_call_count(), 'Expected wp_finalized_template_enhancement_output_buffer action callback to have been called once.' ); 975 975 $action_args = $mock_action_callback->get_args()[0]; 976 $this->assertCount( 1, $action_args, 'Expected the wp_ send_late_headersaction to have been passed only one argument.' );977 $this->assertSame( $output, $action_args[0], 'Expected the arg passed to wp_ send_late_headersto be the same as the processed output buffer.' );976 $this->assertCount( 1, $action_args, 'Expected the wp_finalized_template_enhancement_output_buffer action to have been passed only one argument.' ); 977 $this->assertSame( $output, $action_args[0], 'Expected the arg passed to wp_finalized_template_enhancement_output_buffer to be the same as the processed output buffer.' ); 978 978 } 979 979
Note: See TracChangeset
for help on using the changeset viewer.