STEP 1~7 (거부 기능): - 쿠키 배너에 「동의하지 않고 계속하기」 거부 버튼 추가 (intent=reject) - is_rejected/rejected_at 컬럼 + ConsentAction Enum 3분기 (동의/철회/거부) - 관리자 동의 이력에 [거부] 필터 + amber 배지 STEP A~F (토글 재설계): - 필수 카테고리를 동의 축에서 완전 제외 (status/history 미저장) — ePrivacy Art.5(3) 면제 - 마이페이지 표→토글 전환: 필수=「항상 켜짐」 잠금, 선택=on/off 스위치, 동의일 제거, 「모두 켜기」 바 - 거부 토스트 문구 정정: consent.granted → rejected_saved (배너 + 컨트롤러 응답) 테스트: 백엔드 201/201, 프론트 288/288, 시나리오 커버리지 audit 통과 Chrome MCP 실측: 토글 grant/revoke/모두켜기 + 배너 거부 토스트 + 거부 직후 마이페이지 표기 확인
45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Plugins\Sirsoft\Gdpr\Tests\Unit\Enums;
|
|
|
|
use Plugins\Sirsoft\Gdpr\Enums\ConsentAction;
|
|
use Plugins\Sirsoft\Gdpr\Tests\PluginTestCase;
|
|
|
|
/**
|
|
* ConsentAction Enum 단위 테스트 (이슈 #430 거부 행위 정의).
|
|
*
|
|
* granted / revoked / rejected 3분기 판정 로직을 검증한다.
|
|
*/
|
|
class ConsentActionTest extends PluginTestCase
|
|
{
|
|
public function test_cases_are_defined(): void
|
|
{
|
|
$this->assertSame(
|
|
['granted', 'revoked', 'rejected'],
|
|
ConsentAction::allValues()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @scenario entry=accept_all, subject=member, category=required
|
|
* @effects consent_action_from_decision_granted_revoked_rejected
|
|
*/
|
|
public function test_from_decision_returns_granted_when_value_true(): void
|
|
{
|
|
// 동의 시 거부 신호와 무관하게 항상 granted (필수 항목 등)
|
|
$this->assertSame(ConsentAction::Granted, ConsentAction::fromDecision(true, false));
|
|
$this->assertSame(ConsentAction::Granted, ConsentAction::fromDecision(true, true));
|
|
}
|
|
|
|
public function test_from_decision_returns_rejected_when_value_false_and_rejection(): void
|
|
{
|
|
$this->assertSame(ConsentAction::Rejected, ConsentAction::fromDecision(false, true));
|
|
}
|
|
|
|
public function test_from_decision_returns_revoked_when_value_false_without_rejection(): void
|
|
{
|
|
// 명시적 거부 신호가 없는 미동의는 철회로 취급 (기존 동작 유지)
|
|
$this->assertSame(ConsentAction::Revoked, ConsentAction::fromDecision(false, false));
|
|
}
|
|
}
|