Tests: Move some utility classes to their own files.
Props Frank Klein. Fixes #37523. git-svn-id: https://develop.svn.wordpress.org/trunk@38285 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f3425a50ac
commit
ba9eda1a9b
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Basic_Object {
|
||||||
|
private $foo = 'bar';
|
||||||
|
|
||||||
|
public function __get( $name ) {
|
||||||
|
return $this->$name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __set( $name, $value ) {
|
||||||
|
return $this->$name = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __isset( $name ) {
|
||||||
|
return isset( $this->$name );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __unset( $name ) {
|
||||||
|
unset( $this->$name );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __call( $name, $arguments ) {
|
||||||
|
return call_user_func_array( array( $this, $name ), $arguments );
|
||||||
|
}
|
||||||
|
|
||||||
|
private function callMe() {
|
||||||
|
return 'maybe';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Basic_Subclass extends Basic_Object {}
|
|
@ -58,36 +58,6 @@ function _delete_all_posts() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Basic_Object {
|
|
||||||
private $foo = 'bar';
|
|
||||||
|
|
||||||
public function __get( $name ) {
|
|
||||||
return $this->$name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __set( $name, $value ) {
|
|
||||||
return $this->$name = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __isset( $name ) {
|
|
||||||
return isset( $this->$name );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __unset( $name ) {
|
|
||||||
unset( $this->$name );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __call( $name, $arguments ) {
|
|
||||||
return call_user_func_array( array( $this, $name ), $arguments );
|
|
||||||
}
|
|
||||||
|
|
||||||
private function callMe() {
|
|
||||||
return 'maybe';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Basic_Subclass extends Basic_Object {}
|
|
||||||
|
|
||||||
function _wp_die_handler( $message, $title = '', $args = array() ) {
|
function _wp_die_handler( $message, $title = '', $args = array() ) {
|
||||||
if ( !$GLOBALS['_wp_die_disabled'] ) {
|
if ( !$GLOBALS['_wp_die_disabled'] ) {
|
||||||
_wp_die_handler_txt( $message, $title, $args);
|
_wp_die_handler_txt( $message, $title, $args);
|
||||||
|
@ -147,7 +117,7 @@ function _upload_dir_no_subdir( $uploads ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper used with the `upload_dir` filter to set https upload URL.
|
* Helper used with the `upload_dir` filter to set https upload URL.
|
||||||
*/
|
*/
|
||||||
function _upload_dir_https( $uploads ) {
|
function _upload_dir_https( $uploads ) {
|
||||||
$uploads['url'] = str_replace( 'http://', 'https://', $uploads['url'] );
|
$uploads['url'] = str_replace( 'http://', 'https://', $uploads['url'] );
|
||||||
$uploads['baseurl'] = str_replace( 'http://', 'https://', $uploads['baseurl'] );
|
$uploads['baseurl'] = str_replace( 'http://', 'https://', $uploads['baseurl'] );
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once dirname( dirname( __FILE__ ) ) . '/includes/class-basic-object.php';
|
||||||
|
require_once dirname( dirname( __FILE__ ) ) . '/includes/class-basic-subclass.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* just make sure the test framework is working
|
* just make sure the test framework is working
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue