re #224 add option to require consent

This commit is contained in:
tonydspaniard
2019-08-21 11:13:48 +02:00
parent 07a7a7bda7
commit 5b071dae88
37 changed files with 406 additions and 106 deletions

View File

@ -142,10 +142,10 @@ class GdprCest
$I->see('Export my data', 'h3');
$I->see('Delete my account', 'h3');
$I->amOnRoute('/user/settings/gdpr-delete');
$I->fillField('#gdprdeleteform-password','wrongpassword');
$I->fillField('#gdprdeleteform-password', 'wrongpassword');
$I->click('Delete');
$I->see('Invalid password');
$I->fillField('#gdprdeleteform-password','qwerty');
$I->fillField('#gdprdeleteform-password', 'qwerty');
$I->click('Delete');
$I->see('Login');
}
@ -163,5 +163,22 @@ class GdprCest
$I->amLoggedInAs(1);
$I->amOnRoute('/user/settings/privacy');
$I->seeResponseCodeIs(404);
$I->amOnRoute('/user/settings/privacy');
$I->see('Not Found');
}
public function testForcedConsentRequirement(FunctionalTester $I)
{
$this->_prepareModule(false,false);
/** @var Module $module */
$module = Yii::$app->getModule('user');
$module->gdprRequireConsentToAll = true;
$I->amGoingTo('Try to access a page without giving data processing consent');
$I->amLoggedInAs(1);
$I->amOnRoute('/site/index');
$I->seeElement('.give-consent-panel');
$I->checkOption('#dynamicmodel-gdpr_consent');
$I->click('Submit');
$I->see('Profile settings');
}
}