app->makeWith(InicisIdentityProvider::class, [ 'config' => [], ]); $cache = (new \ReflectionProperty($provider, 'cache'))->getValue($provider); $this->assertInstanceOf(PluginCacheDriver::class, $cache); $this->assertStringStartsWith( 'g7:plugin.sirsoft-verification_kginicis:', $cache->resolveKey('test_key'), 'InicisIdentityProvider 의 캐시 키 prefix 가 본 플러그인 식별자가 아니다.' ); } /** * @scenario extension_kind=plugin,service_kind=cache_service,global_binding_state=installed_before_provider,manager_state=plugin_resolved,consumer_type=multiple_classes * @effects cache_service_receives_plugin_cache_driver_with_correct_identifier_prefix */ public function test_complete_record_listener_receives_plugin_scoped_cache(): void { $listener = $this->app->make(CompleteInicisRecordAfterRegister::class); $cache = (new \ReflectionProperty($listener, 'cache'))->getValue($listener); $this->assertInstanceOf(PluginCacheDriver::class, $cache); $this->assertStringStartsWith( 'g7:plugin.sirsoft-verification_kginicis:', $cache->resolveKey('any_key'), ); } }