3 class TestingAccessWrapperTest
extends MediaWikiTestCase
{
10 require_once __DIR__
. '/../data/helpers/WellProtectedClass.php';
11 $this->raw
= new WellProtectedClass();
12 $this->wrapped
= TestingAccessWrapper
::newFromObject( $this->raw
);
15 function testGetProperty() {
16 $this->assertSame( 1, $this->wrapped
->property
);
19 function testSetProperty() {
20 $this->wrapped
->property
= 10;
21 $this->assertSame( 10, $this->wrapped
->property
);
22 $this->assertSame( 10, $this->raw
->getProperty() );
25 function testCallMethod() {
26 $this->wrapped
->incrementPropertyValue();
27 $this->assertSame( 2, $this->wrapped
->property
);
28 $this->assertSame( 2, $this->raw
->getProperty() );
31 function testCallMethodTwoArgs() {
32 $this->assertSame( 'two', $this->wrapped
->whatSecondArg( 'one', 'two' ) );