Make WordPress Core

Ticket #37523: 37523.2.patch

File 37523.2.patch, 2.0 KB (added by DylanAuty, 9 years ago)

New Revision of the previous patch file I submitted. With the changes suggested by @Frank Klein. I moved the including of the classes to the bootstrap.php file instead. Below the inclusion of the funtions.php file as no reference is made to the classes up to this point. Did not test this, however it seems like the revision would run as expected

  • tests/phpunit/includes/bootstrap.php

     
    2424require_once $config_file_path;
    2525require_once dirname( __FILE__ ) . '/functions.php';
    2626
     27require_once dirname( __FILE__ ) . '/class-basic-object.php';
     28require_once dirname( __FILE__ ) . '/class-basic-subclass.php';
     29
    2730tests_reset__SERVER();
    2831
    2932define( 'WP_TESTS_TABLE_PREFIX', $table_prefix );
  • tests/phpunit/includes/class-basic-object.php

     
    11<?php
     2/**
     3 * Unit Tests: Basic_Object cloass
     4 *
     5 * @package WordPress
     6 * @subpackage UnitTests
     7 * @since 4.7.0
     8 */
    29
     10/**
     11 * Class used to test accessing methods and properties
     12 *
     13 * @since 4.0.0
     14 */
    315class Basic_Object {
    416        private $foo = 'bar';
    517
  • tests/phpunit/includes/class-basic-subclass.php

     
    11<?php
     2/**
     3 * Unit Tests: Basic_Subclass class
     4 *
     5 * @package WordPress
     6 * @subpackage UnitTests
     7 * @since 4.7.0
     8 */
    29
     10/**
     11 * Class used to test accessing methods and properties.
     12 *
     13 * @since 4.0.0
     14 */
    315class Basic_Subclass extends Basic_Object {}
  • tests/phpunit/tests/basic.php

     
    11<?php
    22
    3 require_once dirname( dirname( __FILE__ ) ) . '/includes/class-basic-object.php';
    4 require_once dirname( dirname( __FILE__ ) ) . '/includes/class-basic-subclass.php';
    5 
    63/**
    74 * just make sure the test framework is working
    85 *