File tree Expand file tree Collapse file tree
tests/system/Encryption/Handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818use CodeIgniter \Test \CIUnitTestCase ;
1919use Config \Encryption as EncryptionConfig ;
2020use PHPUnit \Framework \Attributes \Group ;
21- use ReflectionProperty ;
2221use SodiumException ;
2322
2423/**
@@ -167,13 +166,12 @@ public function testBug1MemzeroZeroesInternalKey(): void
167166 {
168167 $ encrypter = $ this ->encryption ->initialize ($ this ->config );
169168
170- $ refKey = new ReflectionProperty ($ encrypter , 'key ' );
171-
172- $ originalKey = $ refKey ->getValue ($ encrypter );
169+ $ prop = 'key ' ;
170+ $ originalKey = $ encrypter ->{$ prop }; // @phpstan-ignore property.notFound
173171
174172 $ encrypter ->encrypt ('message ' );
175173
176- $ this ->assertSame ($ originalKey , $ refKey -> getValue ( $ encrypter ));
174+ $ this ->assertSame ($ originalKey , $ encrypter ->{ $ prop }); // @phpstan-ignore property.notFound
177175 }
178176
179177 public function testBug2InvalidKeyLengthThrowsSodiumException (): void
You can’t perform that action at this time.
0 commit comments