1 [![Latest Stable Version]](https://packagist.org/packages/wikimedia/testing-access-wrapper) [![License]](https://packagist.org/packages/wikimedia/testing-access-wrapper)
3 Wikimedia Testing Access Wrapper
4 ================================
6 Testing Access Wrapper is a simple helper for writing unit tests which provides
7 convenient shortcuts for using reflection to access non-public properties/methods.
9 The code was originally part of MediaWiki. See composer.json for a list of authors.
15 use Wikimedia\TestingAccessWrapper;
19 protected function func() {}
20 protected static function staticFunc() {}
23 $object = new NonPublic();
24 $wrapper = TestingAccessWrapper::newFromObject( $object );
25 $classWrapper = TestingAccessWrapper::newFromClass( NonPublic::class );
27 $wrapper->prop = 'foo';
29 $classWrapper->staticFunc();
40 [Latest Stable Version]: https://poser.pugx.org/wikimedia/testing-access-wrapper/v/stable.svg
41 [License]: https://poser.pugx.org/wikimedia/testing-access-wrapper/license.svg