- Timestamp:
- 01/28/2026 09:28:06 PM (6 months ago)
- Location:
- branches/6.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/dependencies/styles.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/6.9
- Property svn:mergeinfo changed
/trunk merged: 61323,61357,61542
- Property svn:mergeinfo changed
-
branches/6.9/tests/phpunit/tests/dependencies/styles.php
r61536 r61550 816 816 $this->assertEqualHTML( $expected, $printed ); 817 817 } 818 819 /** 820 * Tests that WP_Styles emits a _doing_it_wrong() notice for missing dependencies. 821 * 822 * @ticket 64229 823 * @covers WP_Dependencies::all_deps 824 */ 825 public function test_wp_style_doing_it_wrong_for_missing_dependencies() { 826 $expected_incorrect_usage = 'WP_Styles::add'; 827 $this->setExpectedIncorrectUsage( $expected_incorrect_usage ); 828 829 wp_enqueue_style( 830 'main-style', 831 '/main-style.css', 832 array( 'missing-style-dep' ) 833 ); 834 835 $markup = get_echo( 'wp_print_styles' ); 836 $this->assertStringNotContainsString( 'main-style.css', $markup, 'Expected style to be absent.' ); 837 838 $this->assertArrayHasKey( 839 $expected_incorrect_usage, 840 $this->caught_doing_it_wrong, 841 "Expected $expected_incorrect_usage to trigger a _doing_it_wrong() notice for missing dependency." 842 ); 843 844 $this->assertStringContainsString( 845 'The style with the handle "main-style" was enqueued with dependencies that are not registered: missing-style-dep', 846 $this->caught_doing_it_wrong[ $expected_incorrect_usage ], 847 'Expected _doing_it_wrong() notice to indicate missing dependencies for enqueued styles.' 848 ); 849 } 818 850 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)