From f68312f27e4295accdfcad92d106362d5412f51f Mon Sep 17 00:00:00 2001 From: "E.Alamo" Date: Sun, 27 May 2018 17:47:08 +0200 Subject: [PATCH] Added more tests --- tests/functional/GdprCest.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/functional/GdprCest.php b/tests/functional/GdprCest.php index 8138395..c81d9f0 100644 --- a/tests/functional/GdprCest.php +++ b/tests/functional/GdprCest.php @@ -134,21 +134,37 @@ class GdprCest */ public function testPrivacyPage(FunctionalTester $I) { - $this->_prepareModule(false, false); $I->amGoingTo('try that privacy page works'); $I->amLoggedInAs(1); + $this->_prepareModule(false, false); $I->amOnRoute('/user/settings/privacy'); $I->see('Export my data', 'h3'); $I->see('Delete my account', 'h3'); $I->click('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'); + } - + /** + * Test privacy page + * + * @param FunctionalTester $I + */ + public function testPrivacyPageAccess(FunctionalTester $I) + { + $I->amGoingTo('Try that a user cant access to privacy if GDPR is not enabled'); + $this->_prepareModule(false, false, false); + $I->amLoggedInAs(1); + $I->amOnRoute('/user/settings/privacy'); + $I->see('Not Found'); + $I->amOnRoute('/user/settings/gdprdelete'); + $I->see('Not Found'); + $I->amOnRoute('/user/settings/export'); + $I->see('Not Found'); } }