2016-08-19 15:44:37 +00:00
|
|
|
<?php
|
2016-08-30 14:31:56 +00:00
|
|
|
/**
|
|
|
|
* Unit Tests: Basic_Object cloass
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage UnitTests
|
|
|
|
* @since 4.7.0
|
|
|
|
*/
|
2016-08-19 15:44:37 +00:00
|
|
|
|
2016-08-30 14:31:56 +00:00
|
|
|
/**
|
|
|
|
* Class used to test accessing methods and properties
|
|
|
|
*
|
|
|
|
* @since 4.0.0
|
|
|
|
*/
|
2016-08-19 15:44:37 +00:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2019-07-01 08:00:12 +00:00
|
|
|
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
2016-08-19 15:44:37 +00:00
|
|
|
private function callMe() {
|
|
|
|
return 'maybe';
|
|
|
|
}
|
|
|
|
}
|