3 namespace Wikimedia\Tests\Reflection
;
5 use Wikimedia\Reflection\GhostFieldAccessTrait
;
6 use Wikimedia\Reflection\GhostFieldTestClass
as OldGhostFieldTestClass
;
9 * This class used to contain a $privateField, $protectedField and $publicField.
10 * This is used to test that unserialized instances still have the values of
11 * these ghost fields and the values can be accessed with GhostFieldAccessTrait.
14 #[\AllowDynamicProperties]
15 class GhostFieldTestClass
{
16 use GhostFieldAccessTrait
;
18 public function getPrivateField() {
19 return $this->getGhostFieldValue( 'privateField', OldGhostFieldTestClass
::class );
22 public function getProtectedField() {
23 return $this->getGhostFieldValue( 'protectedField' );
26 public function getPublicField() {
27 return $this->getGhostFieldValue( 'publicField' );
30 // Do not delete this alias; it is needed for GhostFieldAccessTraitTest
31 class_alias( GhostFieldTestClass
::class, 'Wikimedia\\Reflection\\GhostFieldTestClass' );