Add a unit test that demonstrates a magic getter.
See #27881. git-svn-id: https://develop.svn.wordpress.org/trunk@28480 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1b4e4e665a
commit
85ac5c214d
@ -42,3 +42,10 @@ function _delete_all_posts() {
|
||||
}
|
||||
}
|
||||
|
||||
class Basic_Object {
|
||||
private $foo = 'bar';
|
||||
|
||||
function __get( $name ) {
|
||||
return $this->$name;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* just make sure the test framework is working
|
||||
*
|
||||
@ -122,4 +121,10 @@ EOF;
|
||||
|
||||
unset( $empty_array[$page]['bar']['baz'] );
|
||||
}
|
||||
|
||||
function test_magic_getter() {
|
||||
$basic = new Basic_Object();
|
||||
|
||||
$this->assertEquals( 'bar', $basic->foo );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user