Skip to content

Commit

Permalink
fix invalid - character in attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
albertborsos committed Jun 4, 2018
1 parent b8fa583 commit 005318d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Component extends \yii\base\Component
];

const CATEGORY_SESSION = 'session';
const CATEGORY_USAGE_HELPER = 'usage-helper';
const CATEGORY_USAGE_HELPER = 'usage_helper';
const CATEGORY_SOCIAL = 'social';
const CATEGORY_STATISTICS = 'statistics';
const CATEGORY_ADS = 'ads';
Expand Down
4 changes: 2 additions & 2 deletions src/domains/forms/CookieSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function attributeLabels()
$extraCategories = ArrayHelper::map($this->getComponent()->extraCategories, 'id', 'label');
return ArrayHelper::merge([
Component::CATEGORY_SESSION => \Yii::t('cookieconsent/form', 'label.session'),
Component::CATEGORY_USAGE_HELPER => \Yii::t('cookieconsent/form', 'label.usage-helper'),
Component::CATEGORY_USAGE_HELPER => \Yii::t('cookieconsent/form', 'label.usage_helper'),
Component::CATEGORY_SOCIAL => \Yii::t('cookieconsent/form', 'label.social'),
Component::CATEGORY_STATISTICS => \Yii::t('cookieconsent/form', 'label.statistics'),
Component::CATEGORY_ADS => \Yii::t('cookieconsent/form', 'label.ads'),
Expand All @@ -69,7 +69,7 @@ public function attributeHints()
$extraCategories = ArrayHelper::map($this->getComponent()->extraCategories, 'id', 'hint');
return ArrayHelper::merge([
Component::CATEGORY_SESSION => \Yii::t('cookieconsent/form', 'hint.session'),
Component::CATEGORY_USAGE_HELPER => \Yii::t('cookieconsent/form', 'hint.usage-helper'),
Component::CATEGORY_USAGE_HELPER => \Yii::t('cookieconsent/form', 'hint.usage_helper'),
Component::CATEGORY_SOCIAL => \Yii::t('cookieconsent/form', 'hint.social'),
Component::CATEGORY_STATISTICS => \Yii::t('cookieconsent/form', 'hint.statistics'),
Component::CATEGORY_ADS => \Yii::t('cookieconsent/form', 'hint.ads'),
Expand Down
4 changes: 2 additions & 2 deletions src/messages/en/cookieconsent/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
'hint.social' => 'Cookies which are used by social network widgets like Facebook page plugin or Google Maps.',
'hint.statistics' => 'Cookies which helps us to measure the performance of this site. For example tracking conversions in Google Analytics and Facebook.',
'hint.session' => 'Session cookies are required to distinguish users on the site.',
'hint.usage-helper' => 'Cookies to store informations like "Remember me" checkbox on login forms.',
'hint.usage_helper' => 'Cookies to store informations like "Remember me" checkbox on login forms.',
'input.allowed' => 'On',
'input.disallowed' => 'Off',
'label.ads' => 'Ad cookies',
'label.behavior' => 'Behavior cookies',
'label.statistics' => 'Statistic cookies',
'label.session' => 'Session cookies',
'label.social' => 'Social network cookies',
'label.usage-helper' => 'Usage helper cookies',
'label.usage_helper' => 'Usage helper cookies',
];
2 changes: 1 addition & 1 deletion src/messages/en/cookieconsent/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'deny' => 'Deny',
'dismiss' => 'Dismiss',
'form.error.session-is-required' => 'Session category is required!',
'form.error.usage-helper-is-required' => 'Usage helper category is required to store these settings.',
'form.error.usage_helper-is-required' => 'Usage helper category is required to store these settings.',
'link' => 'Link',
'message' => 'Message',
];
4 changes: 2 additions & 2 deletions src/messages/hu/cookieconsent/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
'hint.statistics' => 'Ennek segítésével tudjuk mérni az oldal látogatottsági statisztikáját és hirdetéseink teljesítményét.',
'hint.session' => 'Egy webáruházban ennek köszönhetően láthatja azt a terméket a kosarában amit választott és nem pedig egy másik felhasználó által összeválogatott termékeket.',
'hint.social' => 'Közösségi oldalak widgetjei által használt cookie-k. Ilyen például a Facebook Page Plugin, Facebook Comments Widget vagy a Google Maps térkép is.',
'hint.usage-helper' => 'Ennek segítségével tároljuk például ennek az űrlapnak a beállításait.',
'hint.usage_helper' => 'Ennek segítségével tároljuk például ennek az űrlapnak a beállításait.',
'input.allowed' => 'Be',
'input.disallowed' => 'Ki',
'label.ads' => 'Célzó és Hirdetési sütik',
'label.behavior' => 'Viselkedést elemző sütik',
'label.statistics' => 'Statisztikai sütik',
'label.session' => 'Munkamenet sütik',
'label.social' => 'Közösségi hálózatok sütijei',
'label.usage-helper' => 'Használatot segítő sütik',
'label.usage_helper' => 'Használatot segítő sütik',
];
2 changes: 1 addition & 1 deletion src/messages/hu/cookieconsent/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'Save' => 'Mentés',
'Reset to default' => 'Alapbeállítások visszaállítása',
'form.error.session-is-required' => 'Munkamenet sütiket kötelező engedélyezni!',
'form.error.usagehelper-is-required' => 'Használatot elősegítő sütiket kötelező engedélyezni, hogy el tudjuk tárolni ezeket a beállításokat!',
'form.error.usage_helper-is-required' => 'Használatot elősegítő sütiket kötelező engedélyezni, hogy el tudjuk tárolni ezeket a beállításokat!',
'header' => 'Ez az oldal cookie-kat használ!',
'allow' => 'Engedélyezem',
'deny' => 'Elutasítom',
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/domains/forms/CookieSettingsFormOptInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ public function invalidSettingsProvider()
return [
'session is always required - disabled' => ['options.session', 0, 0, 1, 0, 0, 0],
'session is always required - enabled' => ['options.session', 0, 1, 1, 1, 1, 1],
'usage-helper is always required - disabled' => ['options.usage-helper', 1, 0, 0, 0, 0, 0],
'usage-helper is always required - enabled' => ['options.usage-helper', 1, 1, 0, 1, 1, 1],
'usage_helper is always required - disabled' => ['options.usage_helper', 1, 0, 0, 0, 0, 0],
'usage_helper is always required - enabled' => ['options.usage_helper', 1, 1, 0, 1, 1, 1],
];
}

public function validSettingsProvider()
{
return [
'everything is enabled' => [1, 1, 1, 1, 1, 1],
'everything is disabled but session and usage-helper' => [1, 0, 1, 0, 0, 0],
'everything is disabled but session and usage_helper' => [1, 0, 1, 0, 0, 0],
];
}

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/domains/forms/CookieSettingsFormOptOutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ public function invalidSettingsProvider()
return [
'session is always required - disabled' => ['options.session', 0, 0, 1, 0, 0, 0],
'session is always required - enabled' => ['options.session', 0, 1, 1, 1, 1, 1],
'usage-helper is always required - disabled' => ['options.usage-helper', 1, 0, 0, 0, 0, 0],
'usage-helper is always required - enabled' => ['options.usage-helper', 1, 1, 0, 1, 1, 1],
'usage_helper is always required - disabled' => ['options.usage_helper', 1, 0, 0, 0, 0, 0],
'usage_helper is always required - enabled' => ['options.usage_helper', 1, 1, 0, 1, 1, 1],
];
}

public function validSettingsProvider()
{
return [
'everything is enabled' => [1, 1, 1, 1, 1, 1],
'everything is disabled but session and usage-helper' => [1, 0, 1, 0, 0, 1],
'everything is disabled but session and usage_helper' => [1, 0, 1, 0, 0, 1],
];
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/helpers/CookieConsentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public function typeProvider()
{
return [
'facebook' => ['facebook', 'social', true],
'facebook app' => ['facebook-app', 'usage-helper', true],
'facebook app' => ['facebook-app', 'usage_helper', true],
'facebook pixel' => ['facebook-pixel', 'ads', true],
'google analytics' => ['google-analytics', 'statistics', true],
'google tag manager' => ['google-tag-manager', 'statistics', true],
Expand All @@ -25,7 +25,7 @@ public function typeProvider()
public function categoryProvider()
{
return [
'CATEGORY_USAGE_HELPER' => ['usage-helper', true],
'CATEGORY_USAGE_HELPER' => ['usage_helper', true],
'CATEGORY_SOCIAL' => ['social', true],
'CATEGORY_STATISTICS' => ['statistics', true],
'CATEGORY_ADS' => ['ads', true],
Expand Down

0 comments on commit 005318d

Please sign in to comment.