From 538aebd293217c5f326e1ab34db6c392632d05ab Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 15 Feb 2022 11:11:01 +0100 Subject: [PATCH] feat(form): rename anonymous form to public form --- front/formdisplay.php | 6 +++--- inc/abstracttarget.class.php | 2 +- inc/field/actorfield.class.php | 2 +- inc/field/checkboxesfield.class.php | 2 +- inc/field/datefield.class.php | 2 +- inc/field/datetimefield.class.php | 2 +- inc/field/descriptionfield.class.php | 2 +- inc/field/dropdownfield.class.php | 2 +- inc/field/emailfield.class.php | 2 +- inc/field/filefield.class.php | 2 +- inc/field/floatfield.class.php | 2 +- inc/field/glpiselectfield.class.php | 2 +- inc/field/hiddenfield.class.php | 2 +- inc/field/hostnamefield.class.php | 2 +- inc/field/ipfield.class.php | 2 +- inc/field/ldapselectfield.class.php | 2 +- inc/field/radiosfield.class.php | 2 +- inc/field/requesttypefield.class.php | 2 +- inc/field/tagfield.class.php | 2 +- inc/field/textareafield.class.php | 2 +- inc/field/textfield.class.php | 2 +- inc/field/timefield.class.php | 2 +- inc/field/urgencyfield.class.php | 2 +- inc/fieldinterface.class.php | 4 ++-- inc/form.class.php | 10 +++++----- inc/question.class.php | 2 +- templates/pages/userform.html.twig | 2 +- .../3-unit/GlpiPlugin/Formcreator/Field/ActorField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/CheckboxesField.php | 4 ++-- .../3-unit/GlpiPlugin/Formcreator/Field/DateField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/DatetimeField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/DescriptionField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/DropdownField.php | 4 ++-- .../3-unit/GlpiPlugin/Formcreator/Field/EmailField.php | 4 ++-- .../3-unit/GlpiPlugin/Formcreator/Field/FloatField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/GlpiSelectField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/HiddenField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/IntegerField.php | 4 ++-- tests/3-unit/GlpiPlugin/Formcreator/Field/IpField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/LdapSelectField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/RadiosField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/SelectField.php | 4 ++-- .../3-unit/GlpiPlugin/Formcreator/Field/TextField.php | 4 ++-- .../GlpiPlugin/Formcreator/Field/TextareaField.php | 4 ++-- .../3-unit/GlpiPlugin/Formcreator/Field/TimeField.php | 4 ++-- tests/fixture/PluginFormcreatorDependentField.php | 2 +- 46 files changed, 71 insertions(+), 71 deletions(-) diff --git a/front/formdisplay.php b/front/formdisplay.php index 1f1e98fd6..9d205a933 100644 --- a/front/formdisplay.php +++ b/front/formdisplay.php @@ -60,7 +60,7 @@ // If user is not authenticated, create temporary user if (!isset($_SESSION['glpiname'])) { $_SESSION['formcreator_forms_id'] = $form->getID(); - $_SESSION['formcreator_anonymous'] = true; + $_SESSION['formcreator_public'] = true; $_SESSION['glpiname'] = 'formcreator_temp_user'; $_SESSION['valid_id'] = session_id(); $_SESSION['glpiactiveentities'] = [$form->fields['entities_id']]; @@ -75,9 +75,9 @@ $form->displayUserForm(); // If user was not authenticated, remove temporary user - if (isset($_SESSION['formcreator_anonymous'])) { + if (isset($_SESSION['formcreator_public'])) { unset($_SESSION['glpiname']); - unset($_SESSION['formcreator_anonymous']); + unset($_SESSION['formcreator_public']); session_write_close(); } } else if (isset($_GET['answer_saved'])) { diff --git a/inc/abstracttarget.class.php b/inc/abstracttarget.class.php index 5f327ba5f..d798e06f9 100644 --- a/inc/abstracttarget.class.php +++ b/inc/abstracttarget.class.php @@ -799,7 +799,7 @@ protected function prepareActors(PluginFormcreatorForm $form, PluginFormcreatorF * Adds an user to the given actor role (requester, observer assigned or supplier) * * @param string $role role of the user - * @param string $user user ID or email address for anonymous users + * @param string $user user ID or email address for accountless users * @param bool $notify true to enable notification for the actor * @return boolean true on success, false on error */ diff --git a/inc/field/actorfield.class.php b/inc/field/actorfield.class.php index d25506ffd..6ff6c8ef8 100644 --- a/inc/field/actorfield.class.php +++ b/inc/field/actorfield.class.php @@ -401,7 +401,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return false; } diff --git a/inc/field/checkboxesfield.class.php b/inc/field/checkboxesfield.class.php index e94d0760e..cba3b9c96 100644 --- a/inc/field/checkboxesfield.class.php +++ b/inc/field/checkboxesfield.class.php @@ -369,7 +369,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/datefield.class.php b/inc/field/datefield.class.php index da688874f..3ee5c7751 100644 --- a/inc/field/datefield.class.php +++ b/inc/field/datefield.class.php @@ -217,7 +217,7 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return true; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/datetimefield.class.php b/inc/field/datetimefield.class.php index 7e34a1ddd..ab3bcbba7 100644 --- a/inc/field/datetimefield.class.php +++ b/inc/field/datetimefield.class.php @@ -218,7 +218,7 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return true; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/descriptionfield.class.php b/inc/field/descriptionfield.class.php index 63fe70620..281283e7a 100644 --- a/inc/field/descriptionfield.class.php +++ b/inc/field/descriptionfield.class.php @@ -151,7 +151,7 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return true; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/dropdownfield.class.php b/inc/field/dropdownfield.class.php index 725610f9c..7c33a244e 100644 --- a/inc/field/dropdownfield.class.php +++ b/inc/field/dropdownfield.class.php @@ -768,7 +768,7 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return true; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return false; } diff --git a/inc/field/emailfield.class.php b/inc/field/emailfield.class.php index c5428933e..d5948cde6 100644 --- a/inc/field/emailfield.class.php +++ b/inc/field/emailfield.class.php @@ -174,7 +174,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/filefield.class.php b/inc/field/filefield.class.php index c2e6606c8..d64e8ce11 100644 --- a/inc/field/filefield.class.php +++ b/inc/field/filefield.class.php @@ -291,7 +291,7 @@ public function regex($value): bool { throw new ComparisonException('Meaningless comparison'); } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/floatfield.class.php b/inc/field/floatfield.class.php index 4d52a7051..78d175a68 100644 --- a/inc/field/floatfield.class.php +++ b/inc/field/floatfield.class.php @@ -291,7 +291,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/glpiselectfield.class.php b/inc/field/glpiselectfield.class.php index 2bb31f892..4fda102c6 100644 --- a/inc/field/glpiselectfield.class.php +++ b/inc/field/glpiselectfield.class.php @@ -241,7 +241,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return false; } diff --git a/inc/field/hiddenfield.class.php b/inc/field/hiddenfield.class.php index ac3599503..890772974 100644 --- a/inc/field/hiddenfield.class.php +++ b/inc/field/hiddenfield.class.php @@ -163,7 +163,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/hostnamefield.class.php b/inc/field/hostnamefield.class.php index 54b5beeab..3e1c79e74 100644 --- a/inc/field/hostnamefield.class.php +++ b/inc/field/hostnamefield.class.php @@ -148,7 +148,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/ipfield.class.php b/inc/field/ipfield.class.php index d7573c7c3..3716a842e 100644 --- a/inc/field/ipfield.class.php +++ b/inc/field/ipfield.class.php @@ -160,7 +160,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/ldapselectfield.class.php b/inc/field/ldapselectfield.class.php index 54279cada..df883c752 100644 --- a/inc/field/ldapselectfield.class.php +++ b/inc/field/ldapselectfield.class.php @@ -340,7 +340,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return false; } diff --git a/inc/field/radiosfield.class.php b/inc/field/radiosfield.class.php index eb30fb465..7205fdfa1 100644 --- a/inc/field/radiosfield.class.php +++ b/inc/field/radiosfield.class.php @@ -275,7 +275,7 @@ public function regex($value): bool { return preg_match($value, $this->value) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/requesttypefield.class.php b/inc/field/requesttypefield.class.php index c81b319e3..c45be395d 100644 --- a/inc/field/requesttypefield.class.php +++ b/inc/field/requesttypefield.class.php @@ -223,7 +223,7 @@ public function regex($value): bool { throw new ComparisonException('Meaningless comparison'); } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/tagfield.class.php b/inc/field/tagfield.class.php index b0c94b560..d3353efd5 100644 --- a/inc/field/tagfield.class.php +++ b/inc/field/tagfield.class.php @@ -241,7 +241,7 @@ public function regex($value): bool { throw new ComparisonException('Meaningless comparison'); } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return false; } diff --git a/inc/field/textareafield.class.php b/inc/field/textareafield.class.php index b736ca667..17009245f 100644 --- a/inc/field/textareafield.class.php +++ b/inc/field/textareafield.class.php @@ -272,7 +272,7 @@ public function regex($value): bool { return (preg_grep($value, $this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/textfield.class.php b/inc/field/textfield.class.php index f197d85da..382ff8b26 100644 --- a/inc/field/textfield.class.php +++ b/inc/field/textfield.class.php @@ -273,7 +273,7 @@ public function regex($value): bool { return preg_match($value, Toolbox::stripslashes_deep($this->value)) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/timefield.class.php b/inc/field/timefield.class.php index 9145dbfbc..184798ed7 100644 --- a/inc/field/timefield.class.php +++ b/inc/field/timefield.class.php @@ -210,7 +210,7 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return true; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/field/urgencyfield.class.php b/inc/field/urgencyfield.class.php index da814ad5a..51ecf8851 100644 --- a/inc/field/urgencyfield.class.php +++ b/inc/field/urgencyfield.class.php @@ -227,7 +227,7 @@ public function regex($value): bool { throw new ComparisonException('Meaningless comparison'); } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; } diff --git a/inc/fieldinterface.class.php b/inc/fieldinterface.class.php index 27e8205e7..a33a8db23 100644 --- a/inc/fieldinterface.class.php +++ b/inc/fieldinterface.class.php @@ -252,9 +252,9 @@ public function regex($value) : bool; /** * Is the field compatible with anonymous form ? * - * @return boolean true if the field can work with anonymous forms + * @return boolean true if the field can work with public forms */ - public function isAnonymousFormCompatible() : bool; + public function isPublicFormCompatible() : bool; /** * Gets HTML code for the icon of a field diff --git a/inc/form.class.php b/inc/form.class.php index 2b430ca98..e41c22353 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -1031,7 +1031,7 @@ public function displayUserForm() : void { 'options' => [ 'columns' => PluginFormcreatorSection::COLUMNS, 'domain' => $domain, // For translation - 'anonymous'=> isset($_SESSION['formcreator_anonymous']), + 'public' => isset($_SESSION['formcreator_public']), 'use_captcha' => ($this->fields['access_rights'] == PluginFormcreatorForm::ACCESS_PUBLIC && $this->fields['is_captcha_enabled'] != '0'), ] @@ -1277,7 +1277,7 @@ protected function checkAccessRight(array $input): bool { $fields = $this->getFields(); $incompatibleQuestion = false; foreach ($fields as $field) { - if (!$field->isAnonymousFormCompatible()) { + if (!$field->isPublicFormCompatible()) { $incompatibleQuestion = true; $message = __('The question %s is not compatible with public forms', 'formcreator'); Session::addMessageAfterRedirect(sprintf($message, $field->getLabel()), false, ERROR); @@ -2032,8 +2032,8 @@ public function showForCentral() { } /** - * Is the form accessible anonymously (without being logged in) ? - * @return boolean true if the form is accessible anonymously + * Is the form accessible publicly (without being logged in) ? + * @return boolean true if the form is accessible publicly */ public function isPublicAccess() : bool { if ($this->isNewItem()) { @@ -2480,7 +2480,7 @@ public function setTranslations(string $language, array $translations) : bool { } /** - * Choose the best language for anonymous form + * Choose the best language for publicly form * * @return string the best language for this form and session context */ diff --git a/inc/question.class.php b/inc/question.class.php index f4b4f6983..37cf1e197 100644 --- a/inc/question.class.php +++ b/inc/question.class.php @@ -354,7 +354,7 @@ private function checkBeforeSave($input) : array { $form = PluginFormcreatorCommon::getForm(); $section = PluginFormcreatorSection::getById($input[PluginFormcreatorSection::getForeignKeyField()]); $form = PluginFormcreatorForm::getByItem($section); - if ($form->isPublicAccess() && !$this->field->isAnonymousFormCompatible()) { + if ($form->isPublicAccess() && !$this->field->isPublicFormCompatible()) { Session::addMessageAfterRedirect(__('This type of question is not compatible with public forms.', 'formcreator'), false, ERROR); return []; } diff --git a/templates/pages/userform.html.twig b/templates/pages/userform.html.twig index eda6c00a0..d1e49ac7a 100644 --- a/templates/pages/userform.html.twig +++ b/templates/pages/userform.html.twig @@ -87,7 +87,7 @@ {% endif %} {% endif %} {% endif %} - {% if not options.anonymous or question.getSubField().isAnonymousFormCompatible() %} + {% if not options.public or question.getSubField().isPublicFormCompatible() %} {% set sessionData = session('formcreator') %} {{ question.getRenderedHtml(domain, true, sessionData.data)|raw }} {% endif %} diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/ActorField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/ActorField.php index 46141c13f..f85c6016d 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/ActorField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/ActorField.php @@ -374,9 +374,9 @@ function() { )->isInstanceOf(ComparisonException::class); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isFalse(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/CheckboxesField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/CheckboxesField.php index ff3d3e855..f2b47edf9 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/CheckboxesField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/CheckboxesField.php @@ -265,9 +265,9 @@ public function testGetEmptyParameters() { ->isInstanceOf(\PluginFormcreatorQuestionRange::class); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/DateField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/DateField.php index c28535afd..0b27a6599 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/DateField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/DateField.php @@ -117,9 +117,9 @@ public function testGetName() { $this->string($output)->isEqualTo('Date'); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/DatetimeField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/DatetimeField.php index c105e1785..d7a27aaf2 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/DatetimeField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/DatetimeField.php @@ -244,9 +244,9 @@ public function testNotEquals($value, $answer, $expected) { $this->boolean($instance->notEquals($value))->isEqualTo($expected); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/DescriptionField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/DescriptionField.php index e13702761..ea83c5823 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/DescriptionField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/DescriptionField.php @@ -88,9 +88,9 @@ public function testPrepareQuestionInputForSave($input, $expected, $message) { } } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/DropdownField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/DropdownField.php index b9e211d7f..c88cbd85c 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/DropdownField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/DropdownField.php @@ -106,9 +106,9 @@ public function testPrepareQuestionInputForSave($input, $expected) { } } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isFalse(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/EmailField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/EmailField.php index 79212d0c3..3869a2941 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/EmailField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/EmailField.php @@ -97,10 +97,10 @@ public function testSerializeValue($value, $expected) { $this->string($output)->isEqualTo($expected ? $value : ''); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $question = $this->getQuestion(); $instance = $this->newTestedInstance($question); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isEqualTo(true); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/FloatField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/FloatField.php index 3099f1781..9d499eb2b 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/FloatField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/FloatField.php @@ -301,9 +301,9 @@ public function testGetEmptyParameters() { ->isInstanceOf(\PluginFormcreatorQuestionRegex::class); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/GlpiSelectField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/GlpiSelectField.php index be44ca5b6..dcaea542d 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/GlpiSelectField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/GlpiSelectField.php @@ -239,9 +239,9 @@ public function testIsValid($fields, $expectedValue, $expectedValidity) { $this->boolean($output)->isEqualTo($expectedValidity); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isFalse(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/HiddenField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/HiddenField.php index 3331dfc70..b7d882d1d 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/HiddenField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/HiddenField.php @@ -44,9 +44,9 @@ public function testIsValid() { $this->boolean($output)->isTrue(); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/IntegerField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/IntegerField.php index aa90f6a2b..ed4b670be 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/IntegerField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/IntegerField.php @@ -248,9 +248,9 @@ public function testIsValid($fields, $expectedValue, $expectedValidity) { $this->boolean((boolean) $isValid)->isEqualTo($expectedValidity); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/IpField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/IpField.php index d462a1e42..2ccb2b43a 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/IpField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/IpField.php @@ -47,9 +47,9 @@ public function testIsValid() { $this->boolean($output)->isTrue(); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/LdapSelectField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/LdapSelectField.php index 5c843cca6..d690adaa4 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/LdapSelectField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/LdapSelectField.php @@ -41,9 +41,9 @@ public function testGetName() { $this->string($output)->isEqualTo('LDAP Select'); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isFalse(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/RadiosField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/RadiosField.php index b18889b18..163fa2140 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/RadiosField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/RadiosField.php @@ -81,9 +81,9 @@ public function testGetName() { } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/SelectField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/SelectField.php index 282824ee5..6dce89f94 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/SelectField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/SelectField.php @@ -221,9 +221,9 @@ public function testGetName() { $this->string($output)->isEqualTo('Select'); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/TextField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/TextField.php index 64394d374..c8ff6070e 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/TextField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/TextField.php @@ -238,9 +238,9 @@ public function testGetName() { $this->string($output)->isEqualTo('Text'); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/TextareaField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/TextareaField.php index 5db68c653..87a0631fa 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/TextareaField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/TextareaField.php @@ -38,9 +38,9 @@ public function testGetName() { $this->string($output)->isEqualTo('Textarea'); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/3-unit/GlpiPlugin/Formcreator/Field/TimeField.php b/tests/3-unit/GlpiPlugin/Formcreator/Field/TimeField.php index 435104140..bbc469400 100644 --- a/tests/3-unit/GlpiPlugin/Formcreator/Field/TimeField.php +++ b/tests/3-unit/GlpiPlugin/Formcreator/Field/TimeField.php @@ -249,9 +249,9 @@ public function testNotEquals($value, $answer, $expected) { $this->boolean($instance->notEquals($value))->isEqualTo($expected); } - public function testIsAnonymousFormCompatible() { + public function testisPublicFormCompatible() { $instance = $this->newTestedInstance($this->getQuestion()); - $output = $instance->isAnonymousFormCompatible(); + $output = $instance->isPublicFormCompatible(); $this->boolean($output)->isTrue(); } diff --git a/tests/fixture/PluginFormcreatorDependentField.php b/tests/fixture/PluginFormcreatorDependentField.php index 7968fb953..3e34c2b36 100644 --- a/tests/fixture/PluginFormcreatorDependentField.php +++ b/tests/fixture/PluginFormcreatorDependentField.php @@ -253,7 +253,7 @@ public function regex($value): bool { return preg_match($value, $this->value) ? true : false; } - public function isAnonymousFormCompatible(): bool { + public function isPublicFormCompatible(): bool { return true; }