WordPress.org

Make WordPress Core

Changeset 788 in tests


Ignore:
Timestamp:
06/30/12 19:03:08 (3 years ago)
Author:
nacin
Message:

Port test cases for WP_Dependencies, WP_Styles, and WP_Scripts.

In the old framework, WP_CONTENT_URL was relative. Now it's not. plugins_url() is supposed to return an absolute URL. Hence the removal of it for local resource testing.

fixes #90, #88, #71.

Location:
trunk/wp-testcase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testcase/test_includes_class-wp-dependencies.php

    r407 r788  
    11<?php 
    2 class TestWP_Dependencies extends WPTestCase { 
     2class TestWP_Dependencies extends WP_UnitTestCase { 
    33    function test_add() { 
    44        // Create a new object 
  • trunk/wp-testcase/test_includes_wp-scripts.php

    r749 r788  
    11<?php 
    2 class TestWP_Scripts extends WPTestCase { 
     2class TestWP_Scripts extends WP_UnitTestCase { 
    33    var $old_wp_scripts; 
    44 
     
    6464 
    6565        // Try with a local resource and an automatic protocol reference (//) 
    66         $url = '/' . plugins_url( '/my_plugin/script.js'); 
    67         wp_enqueue_script( 'plugin-script', $url  ); 
     66        $url = '//my_plugin/script.js'; 
     67        wp_enqueue_script( 'plugin-script', $url ); 
    6868        $expected  .= "<script type='text/javascript' src='$url?ver=$ver'></script>\n"; 
    6969 
  • trunk/wp-testcase/test_includes_wp-styles.php

    r749 r788  
    11<?php 
    2 class TestWP_Styles extends WPTestCase { 
     2class TestWP_Styles extends WP_UnitTestCase { 
    33    var $old_wp_styles; 
    44 
     
    6060        wp_enqueue_style( 'reset-css-doubleslash', '//yui.yahooapis.com/2.8.1/build/reset/reset-min.css' ); 
    6161        $expected  .= "<link rel='stylesheet' id='reset-css-doubleslash-css'  href='//yui.yahooapis.com/2.8.1/build/reset/reset-min.css?ver=$ver' type='text/css' media='all' />\n"; 
    62          
     62 
    6363        // Try with a local resource and an automatic protocol reference (//) 
    64         $url = '/' . plugins_url( '/my_plugin/style.css'); 
    65         wp_enqueue_style( 'plugin-style', $url  ); 
     64        $url = '//my_plugin/style.css'; 
     65        wp_enqueue_style( 'plugin-style', $url ); 
    6666        $expected  .= "<link rel='stylesheet' id='plugin-style-css'  href='$url?ver=$ver' type='text/css' media='all' />\n"; 
    6767 
Note: See TracChangeset for help on using the changeset viewer.