Repository navigation
Tests: Cover wp_enqueue_code_editor() when syntax highlighting is disabled
#16238
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
73bc928
1b6ea9f
6d18e08
60847c9
4f6ffbe
e3e1967
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||||||||||||||||||||||||
| <?php | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||
| * Tests for the `wp_enqueue_code_editor()` function. | ||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||
| * @group general | ||||||||||||||||||||||||||||||||
| * @group dependencies | ||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||
| * @covers ::wp_enqueue_code_editor | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| class Tests_General_WpEnqueueCodeEditor extends WP_UnitTestCase { | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||
| * Tests that a logged-in user with syntax highlighting disabled gets false. | ||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||
| * @ticket 66828 | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| public function test_wp_enqueue_code_editor_returns_false_when_syntax_highlighting_disabled() { | ||||||||||||||||||||||||||||||||
| $user_id = self::factory()->user->create(); | ||||||||||||||||||||||||||||||||
| wp_set_current_user( $user_id ); | ||||||||||||||||||||||||||||||||
| wp_get_current_user()->syntax_highlighting = 'false'; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| $this->assertFalse( | ||||||||||||||||||||||||||||||||
| wp_enqueue_code_editor( | ||||||||||||||||||||||||||||||||
| array( | ||||||||||||||||||||||||||||||||
| 'type' => 'text/css', | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other early return, for empty filtered settings, isn't covered anywhere. When I removed the
Suggested change
|
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.