• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress develop tests

WordPress develop tests

WordPress develop tests a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Test_WP_Widget_Custom_HTML::test_enqueue_admin_scripts_when_logged_in_and_syntax_highlighting_on() – Test enqueue_admin_scripts method. Condition: logged_in, syntax_highlighting is on.

You appear to be a bot. Output may be restricted

Description

Test enqueue_admin_scripts method. Condition: logged_in, syntax_highlighting is on.

Usage

Test_WP_Widget_Custom_HTML::test_enqueue_admin_scripts_when_logged_in_and_syntax_highlighting_on();

Parameters

Returns

void

Source

File name: wordpress-develop-tests/phpunit/tests/widgets/custom-html-widget.php


Lines:

1 to 16 of 16
  public function test_enqueue_admin_scripts_when_logged_in_and_syntax_highlighting_on() {
    $user = $this->factory()->user->create();
    wp_set_current_user( $user );
    wp_get_current_user()->syntax_highlighting = 'true';
    set_current_screen( 'widgets.php' );
    $widget = new WP_Widget_Custom_HTML();
    $widget->enqueue_admin_scripts();

    $this->assertTrue( wp_script_is( 'custom-html-widgets', 'enqueued' ) );
    $this->assertTrue( wp_script_is( 'code-editor', 'enqueued' ) );
    $this->assertTrue( wp_script_is( 'wp-codemirror', 'enqueued' ) );
    $this->assertTrue( wp_script_is( 'csslint', 'enqueued' ) );
    $this->assertTrue( wp_script_is( 'jshint', 'enqueued' ) );
    $this->assertTrue( wp_script_is( 'htmlhint', 'enqueued' ) );
  }
 

 View on GitHub

Published: 26th November 2019 | Last updated: 27th November 2019

Primary Sidebar

Information

Function name: Test_WP_Widget_Custom_HTML::test_enqueue_admin_scripts_when_logged_in_and_syntax_highlighting_on
Class ref: Test_WP_Widget_Custom_HTML
Plugin ref: WordPress develop tests
Version: 5.3
Sourcefile: phpunit/tests/widgets/custom-html-widget.php
File ref: phpunit/tests/widgets/custom-html-widget.php
Deprecated?: No
API Letters: C,H,T,W

Footer

WordPress develop tests
WordPress develop tests
WordPress develop tests a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  develop.wp-a2z.org
© Copyright WordPress develop tests 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites