chore(payment): NHN KCP와 NICE 결제 플러그인 개발 브랜치 분리
정식 develop에서는 기본 번들 정책에 따라 제거된 결제 플러그인을 별도 개발 브랜치에서 계속 유지보수할 수 있도록 복원한다.
This commit is contained in:
1 parent
49b21e788c
commit
657f546efc
651 files changed
+49118
-20476
No files matched your search
@@ -2,11 +2,9 @@
|
||||
|
||||
namespace Tests\Unit\Extension;
|
||||
|
||||
use App\Contracts\Repositories\IdentityPolicyRepositoryInterface;
|
||||
use App\Extension\ModuleManager;
|
||||
use App\Extension\PluginManager;
|
||||
use App\Extension\TemplateManager;
|
||||
use App\Listeners\NotificationHookListener;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Tests\TestCase;
|
||||
@@ -28,31 +26,18 @@ class InstallerCompletedGuardTest extends TestCase
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 콜백 실행 중 발생한 information_schema.tables 쿼리만 수집합니다.
|
||||
*
|
||||
* @param callable $callback 계측할 코드
|
||||
* @return array<int, array<string, mixed>> information_schema.tables 쿼리 목록
|
||||
*/
|
||||
private function captureSchemaTableQueries(callable $callback): array
|
||||
{
|
||||
DB::enableQueryLog();
|
||||
$callback();
|
||||
$queries = DB::getQueryLog();
|
||||
DB::disableQueryLog();
|
||||
|
||||
return array_filter(
|
||||
$queries,
|
||||
fn ($q) => str_contains($q['query'], 'information_schema.tables')
|
||||
);
|
||||
}
|
||||
|
||||
public function test_module_trait_skips_has_table_when_installer_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => true]);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => ModuleManager::getActiveModuleIdentifiers()
|
||||
DB::enableQueryLog();
|
||||
ModuleManager::getActiveModuleIdentifiers();
|
||||
$queries = DB::getQueryLog();
|
||||
DB::disableQueryLog();
|
||||
|
||||
$schemaQueries = array_filter(
|
||||
$queries,
|
||||
fn ($q) => str_contains($q['query'], 'information_schema.tables')
|
||||
);
|
||||
|
||||
$this->assertCount(0, $schemaQueries, 'installer_completed=true 에서는 information_schema.tables 쿼리가 발생하지 않아야 합니다');
|
||||
@@ -62,8 +47,14 @@ class InstallerCompletedGuardTest extends TestCase
|
||||
{
|
||||
config(['app.installer_completed' => true]);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => PluginManager::getActivePluginIdentifiers()
|
||||
DB::enableQueryLog();
|
||||
PluginManager::getActivePluginIdentifiers();
|
||||
$queries = DB::getQueryLog();
|
||||
DB::disableQueryLog();
|
||||
|
||||
$schemaQueries = array_filter(
|
||||
$queries,
|
||||
fn ($q) => str_contains($q['query'], 'information_schema.tables')
|
||||
);
|
||||
|
||||
$this->assertCount(0, $schemaQueries);
|
||||
@@ -73,8 +64,14 @@ class InstallerCompletedGuardTest extends TestCase
|
||||
{
|
||||
config(['app.installer_completed' => true]);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => TemplateManager::getActiveTemplateIdentifiers()
|
||||
DB::enableQueryLog();
|
||||
TemplateManager::getActiveTemplateIdentifiers();
|
||||
$queries = DB::getQueryLog();
|
||||
DB::disableQueryLog();
|
||||
|
||||
$schemaQueries = array_filter(
|
||||
$queries,
|
||||
fn ($q) => str_contains($q['query'], 'information_schema.tables')
|
||||
);
|
||||
|
||||
$this->assertCount(0, $schemaQueries);
|
||||
@@ -84,105 +81,14 @@ class InstallerCompletedGuardTest extends TestCase
|
||||
{
|
||||
config(['app.installer_completed' => false]);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => ModuleManager::getActiveModuleIdentifiers()
|
||||
);
|
||||
DB::enableQueryLog();
|
||||
ModuleManager::getActiveModuleIdentifiers();
|
||||
$queries = DB::getQueryLog();
|
||||
DB::disableQueryLog();
|
||||
|
||||
$this->assertGreaterThan(0, count($schemaQueries), 'installer_completed=false 에서는 기존 hasTable 경로가 실행되어야 합니다');
|
||||
}
|
||||
|
||||
/**
|
||||
* NotificationHookListener::registerDynamicHooks() 의 hasTable 가드 검증.
|
||||
*
|
||||
* 부팅 시점 동적 훅 등록 경로 — 설치 완료 상태에서 매 요청
|
||||
* `information_schema.tables` 조회(notification_definitions)가 사라져야 합니다.
|
||||
*/
|
||||
public function test_notification_listener_skips_has_table_when_installer_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => true]);
|
||||
|
||||
$listener = app(NotificationHookListener::class);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => $listener->registerDynamicHooks()
|
||||
);
|
||||
|
||||
$this->assertCount(0, $schemaQueries, 'installer_completed=true 에서는 notification_definitions hasTable 조회가 발생하지 않아야 합니다');
|
||||
}
|
||||
|
||||
public function test_notification_listener_falls_back_to_has_table_when_installer_not_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => false]);
|
||||
|
||||
$listener = app(NotificationHookListener::class);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => $listener->registerDynamicHooks()
|
||||
);
|
||||
|
||||
$this->assertGreaterThan(0, count($schemaQueries), 'installer_completed=false 에서는 기존 hasTable 경로가 실행되어야 합니다');
|
||||
}
|
||||
|
||||
/**
|
||||
* IdentityPolicyRepository::listHookTargets() 의 hasTable 가드 검증.
|
||||
*
|
||||
* 부팅 시점 IDV 동적 hook target 동기화 경로 — 설치 완료 상태에서
|
||||
* `information_schema.tables` 조회(identity_policies)가 사라져야 합니다.
|
||||
*/
|
||||
public function test_identity_policy_list_hook_targets_skips_has_table_when_installer_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => true]);
|
||||
|
||||
$repository = app(IdentityPolicyRepositoryInterface::class);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => $repository->listHookTargets()
|
||||
);
|
||||
|
||||
$this->assertCount(0, $schemaQueries, 'installer_completed=true 에서는 identity_policies hasTable 조회가 발생하지 않아야 합니다');
|
||||
}
|
||||
|
||||
public function test_identity_policy_list_hook_targets_falls_back_when_installer_not_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => false]);
|
||||
|
||||
$repository = app(IdentityPolicyRepositoryInterface::class);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => $repository->listHookTargets()
|
||||
);
|
||||
|
||||
$this->assertGreaterThan(0, count($schemaQueries), 'installer_completed=false 에서는 기존 hasTable 경로가 실행되어야 합니다');
|
||||
}
|
||||
|
||||
/**
|
||||
* IdentityPolicyRepository::activeExtensionIdentifiers() 의 hasTable 가드 검증.
|
||||
*
|
||||
* `resolveByScopeTarget()` → `applyActiveExtensionScope()` → `activeExtensionIdentifiers()`
|
||||
* 경로로 modules/plugins 테이블 hasTable 조회가 트리거되며, 설치 완료 상태에서는
|
||||
* 해당 `information_schema.tables` 조회가 사라져야 합니다.
|
||||
*/
|
||||
public function test_active_extension_scope_skips_has_table_when_installer_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => true]);
|
||||
|
||||
$repository = app(IdentityPolicyRepositoryInterface::class);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => $repository->resolveByScopeTarget('hook', 'core.auth.signup_before_submit')
|
||||
);
|
||||
|
||||
$this->assertCount(0, $schemaQueries, 'installer_completed=true 에서는 modules/plugins hasTable 조회가 발생하지 않아야 합니다');
|
||||
}
|
||||
|
||||
public function test_active_extension_scope_falls_back_when_installer_not_completed(): void
|
||||
{
|
||||
config(['app.installer_completed' => false]);
|
||||
|
||||
$repository = app(IdentityPolicyRepositoryInterface::class);
|
||||
|
||||
$schemaQueries = $this->captureSchemaTableQueries(
|
||||
fn () => $repository->resolveByScopeTarget('hook', 'core.auth.signup_before_submit')
|
||||
$schemaQueries = array_filter(
|
||||
$queries,
|
||||
fn ($q) => str_contains($q['query'], 'information_schema.tables')
|
||||
);
|
||||
|
||||
$this->assertGreaterThan(0, count($schemaQueries), 'installer_completed=false 에서는 기존 hasTable 경로가 실행되어야 합니다');
|
||||
|
||||
Reference in new issue
Block a user