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:
Scott Taylor 2014-05-18 21:14:13 +00:00
parent 1b4e4e665a
commit 85ac5c214d
2 changed files with 13 additions and 1 deletions

View File

@ -42,3 +42,10 @@ function _delete_all_posts() {
}
}
class Basic_Object {
private $foo = 'bar';
function __get( $name ) {
return $this->$name;
}
}

View File

@ -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 );
}
}