Skip to content
Snippets Groups Projects
Commit b8e406fa authored by Kim Pepper's avatar Kim Pepper
Browse files

#3435205 Add gitlab ci template

parent 98ae3a42
No related branches found
No related tags found
1 merge request!4#3435205 Add gitlab ci template
Pipeline #128217 passed
################
# DrupalCI GitLabCI template
#
# Gitlab-ci.yml to replicate DrupalCI testing for Contrib
#
# With thanks to:
# * The GitLab Acceleration Initiative participants
# * DrupalSpoons
################
################
# Guidelines
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification. It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
#
# However, you can modify this template if you have additional needs for your project.
################
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################
include:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
# "ref" value can be:
# - Recommended (default) - `ref: $_GITLAB_TEMPLATES_REF` - The Drupal Association will update this value to the recommended tag for contrib.
# - Latest - `ref: main` - Get the latest additions and bug fixes as they are merged into the templates.
# - Minor or Major latests - `ref: 1.x-latest` or `ref: 1.0.x-latest` - Get the latest additions within a minor (mostly bugfixes) or major (bugs and new features).
# - Fixed tag - `ref: 1.0.1` - Set the value to a known tag. This will not get any updates.
# If you change the default value of ref, you should set the _CURL_TEMPLATES_REF variable in the variables section to be the same as set here.
ref: $_GITLAB_TEMPLATES_REF
file:
- "/includes/include.drupalci.main.yml"
# For Drupal 7, remove the above line and uncomment the below.
# - "/includes/include.drupalci.main-d7.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
#
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
################
variables:
_CSPELL_WORDS: 'endroid,hotp,otpauth,otphp,totp'
# SKIP_ESLINT: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
###################################################################################
#
# *
# /(
# ((((,
# /(((((((
# ((((((((((*
# ,(((((((((((((((
# ,(((((((((((((((((((
# ((((((((((((((((((((((((*
# *(((((((((((((((((((((((((((((
# ((((((((((((((((((((((((((((((((((*
# *(((((((((((((((((( .((((((((((((((((((
# ((((((((((((((((((. /(((((((((((((((((*
# /((((((((((((((((( .(((((((((((((((((,
# ,(((((((((((((((((( ((((((((((((((((((
# .(((((((((((((((((((( .(((((((((((((((((
# ((((((((((((((((((((((( ((((((((((((((((/
# (((((((((((((((((((((((((((/ ,(((((((((((((((*
# .((((((((((((((/ /(((((((((((((. ,(((((((((((((((
# *(((((((((((((( ,(((((((((((((/ *((((((((((((((.
# ((((((((((((((, /(((((((((((((. ((((((((((((((,
# (((((((((((((/ ,(((((((((((((* ,(((((((((((((,
# *((((((((((((( .((((((((((((((( ,(((((((((((((
# ((((((((((((/ /((((((((((((((((((. ,((((((((((((/
# ((((((((((((( *(((((((((((((((((((((((* *((((((((((((
# ((((((((((((( ,(((((((((((((..((((((((((((( *((((((((((((
# ((((((((((((, /((((((((((((* /((((((((((((/ ((((((((((((
# ((((((((((((( /((((((((((((/ (((((((((((((* ((((((((((((
# (((((((((((((/ /(((((((((((( ,((((((((((((, *((((((((((((
# (((((((((((((( *(((((((((((/ *((((((((((((. ((((((((((((/
# *((((((((((((((((((((((((((, /(((((((((((((((((((((((((
# ((((((((((((((((((((((((( ((((((((((((((((((((((((,
# .(((((((((((((((((((((((/ ,(((((((((((((((((((((((
# ((((((((((((((((((((((/ ,(((((((((((((((((((((/
# *((((((((((((((((((((( (((((((((((((((((((((,
# ,(((((((((((((((((((((, ((((((((((((((((((((/
# ,(((((((((((((((((((((* /((((((((((((((((((((
# ((((((((((((((((((((((, ,/((((((((((((((((((((,
# ,(((((((((((((((((((((((((((((((((((((((((((((((((((
# .(((((((((((((((((((((((((((((((((((((((((((((
# .((((((((((((((((((((((((((((((((((((,.
# .,(((((((((((((((((((((((((.
#
###################################################################################
parameters:
ignoreErrors:
-
message: "#^Function one_time_password_install\\(\\) has no return type specified\\.$#"
count: 1
path: one_time_password.install
-
message: "#^Function one_time_password_entity_base_field_info_alter\\(\\) has no return type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_entity_base_field_info_alter\\(\\) has parameter \\$fields with no type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_entity_field_access\\(\\) has no return type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_entity_field_access\\(\\) has parameter \\$items with generic interface Drupal\\\\Core\\\\Field\\\\FieldItemListInterface but does not specify its types\\: T$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_entity_field_access\\(\\) has parameter \\$operation with no type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_form_user_login_form_alter\\(\\) has no return type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_form_user_login_form_alter\\(\\) has parameter \\$form with no type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Function one_time_password_theme\\(\\) has no return type specified\\.$#"
count: 1
path: one_time_password.module
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:getOneTimePassword\\(\\)\\.$#"
count: 1
path: src/Form/PasswordSetupForm.php
-
message: "#^Cannot access property \\$one_time_password on Drupal\\\\user\\\\Entity\\\\User\\|null\\.$#"
count: 2
path: src/Form/PasswordSetupForm.php
-
message: "#^Cannot access property \\$one_time_password on mixed\\.$#"
count: 2
path: src/Form/PasswordSetupForm.php
-
message: "#^Cannot call method save\\(\\) on mixed\\.$#"
count: 2
path: src/Form/PasswordSetupForm.php
-
message: "#^Method Drupal\\\\one_time_password\\\\Form\\\\PasswordSetupForm\\:\\:disableTwoFactorAuth\\(\\) has no return type specified\\.$#"
count: 1
path: src/Form/PasswordSetupForm.php
-
message: "#^Method Drupal\\\\one_time_password\\\\Form\\\\PasswordSetupForm\\:\\:enableTwoFactorAuth\\(\\) has no return type specified\\.$#"
count: 1
path: src/Form/PasswordSetupForm.php
-
message: "#^Method Drupal\\\\one_time_password\\\\Form\\\\PasswordSetupForm\\:\\:submitForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/Form/PasswordSetupForm.php
-
message: "#^Method Drupal\\\\one_time_password\\\\Plugin\\\\Field\\\\FieldType\\\\ProvisioningUriItem\\:\\:getOneTimePassword\\(\\) should return OTPHP\\\\TOTPInterface but returns OTPHP\\\\OTPInterface\\.$#"
count: 1
path: src/Plugin/Field/FieldType/ProvisioningUriItem.php
-
message: "#^Class Drupal\\\\one_time_password\\\\Plugin\\\\Field\\\\FieldType\\\\ProvisioningUriItemList extends generic class Drupal\\\\Core\\\\Field\\\\FieldItemList but does not specify its types\\: T$#"
count: 1
path: src/Plugin/Field/FieldType/ProvisioningUriItemList.php
-
message: "#^Method Drupal\\\\one_time_password\\\\Plugin\\\\Field\\\\FieldType\\\\ProvisioningUriItemList\\:\\:regenerateOneTimePassword\\(\\) has no return type specified\\.$#"
count: 1
path: src/Plugin/Field/FieldType/ProvisioningUriItemList.php
-
message: "#^Parameter \\#1 \\$label of method OTPHP\\\\OTPInterface\\:\\:setLabel\\(\\) expects string, Drupal\\\\Core\\\\StringTranslation\\\\TranslatableMarkup\\|string\\|null given\\.$#"
count: 1
path: src/Plugin/Field/FieldType/ProvisioningUriItemList.php
-
message: "#^Property Drupal\\\\one_time_password\\\\Plugin\\\\Field\\\\FieldType\\\\ProvisioningUriItemList\\:\\:\\$list \\(array\\<Drupal\\\\one_time_password\\\\Plugin\\\\Field\\\\FieldType\\\\ProvisioningUriItem\\>\\) does not accept array\\<Drupal\\\\Core\\\\Field\\\\FieldItemInterface\\>\\.$#"
count: 1
path: src/Plugin/Field/FieldType/ProvisioningUriItemList.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:create\\(\\) has no return type specified\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:entityBaseFieldInfoAlter\\(\\) has no return type specified\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:entityBaseFieldInfoAlter\\(\\) has parameter \\$fields with no type specified\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:entityFieldAccess\\(\\) has no return type specified\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:entityFieldAccess\\(\\) has parameter \\$items with generic interface Drupal\\\\Core\\\\Field\\\\FieldItemListInterface but does not specify its types\\: T$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:entityFieldAccess\\(\\) has parameter \\$operation with no type specified\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserFieldAttach\\:\\:installFieldDefinition\\(\\) has no return type specified\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
path: src/UserFieldAttach.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:getOneTimePassword\\(\\)\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Cannot access property \\$one_time_password on Drupal\\\\user\\\\Entity\\\\User\\|null\\.$#"
count: 2
path: src/UserLoginEnforce.php
-
message: "#^Cannot call method getClientIp\\(\\) on Symfony\\\\Component\\\\HttpFoundation\\\\Request\\|null\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserLoginEnforce\\:\\:formUserLoginFormAlter\\(\\) has no return type specified\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserLoginEnforce\\:\\:formUserLoginFormAlter\\(\\) has parameter \\$form with no type specified\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserLoginEnforce\\:\\:validateOneTimePassword\\(\\) has no return type specified\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Method Drupal\\\\one_time_password\\\\UserLoginEnforce\\:\\:validateOneTimePassword\\(\\) has parameter \\$form with no type specified\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Parameter \\#1 \\$otp of method OTPHP\\\\TOTP\\:\\:verify\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Parameter \\#3 \\$identifier of method Drupal\\\\Core\\\\Flood\\\\FloodInterface\\:\\:register\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Parameter \\#4 \\$identifier of method Drupal\\\\Core\\\\Flood\\\\FloodInterface\\:\\:isAllowed\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/UserLoginEnforce.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:regenerateOneTimePassword\\(\\)\\.$#"
count: 1
path: tests/src/Functional/InstallationTest.php
-
message: "#^Cannot access property \\$one_time_password on Drupal\\\\user\\\\Entity\\\\User\\|null\\.$#"
count: 1
path: tests/src/Functional/InstallationTest.php
-
message: "#^Cannot call method save\\(\\) on Drupal\\\\user\\\\Entity\\\\User\\|null\\.$#"
count: 1
path: tests/src/Functional/InstallationTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\InstallationTest\\:\\:testInstallUninstall\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/InstallationTest.php
-
message: "#^PHPDoc type array of property Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\InstallationTest\\:\\:\\$modules is not covariant with PHPDoc type array\\<string\\> of overridden property Drupal\\\\Tests\\\\BrowserTestBase\\:\\:\\$modules\\.$#"
count: 1
path: tests/src/Functional/InstallationTest.php
-
message: "#^Cannot call method id\\(\\) on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 4
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^Cannot call method toUrl\\(\\) on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 1
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\PasswordSetupFormTest\\:\\:reloadUser\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\PasswordSetupFormTest\\:\\:reloadUser\\(\\) has parameter \\$id with no type specified\\.$#"
count: 1
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\PasswordSetupFormTest\\:\\:testForm\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^PHPDoc type array of property Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\PasswordSetupFormTest\\:\\:\\$modules is not covariant with PHPDoc type array\\<string\\> of overridden property Drupal\\\\Tests\\\\BrowserTestBase\\:\\:\\$modules\\.$#"
count: 1
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^Parameter \\#1 \\$account of method Drupal\\\\Tests\\\\BrowserTestBase\\:\\:drupalLogin\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#"
count: 1
path: tests/src/Functional/PasswordSetupFormTest.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:getOneTimePassword\\(\\)\\.$#"
count: 3
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:regenerateOneTimePassword\\(\\)\\.$#"
count: 6
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Cannot access property \\$one_time_password on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 9
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Cannot access property \\$passRaw on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 10
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Cannot access property \\$sessionId on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 3
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Cannot call method getAccountName\\(\\) on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 11
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Cannot call method save\\(\\) on Drupal\\\\user\\\\Entity\\\\User\\|false\\.$#"
count: 6
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\UserLoginEnforceTest\\:\\:testFloodControlWithCorrectCredentials\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\UserLoginEnforceTest\\:\\:testFloodTableInformationDisclosure\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\UserLoginEnforceTest\\:\\:testLoginWindow\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\UserLoginEnforceTest\\:\\:testOtpFloodControl\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\UserLoginEnforceTest\\:\\:testUserLogin\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^PHPDoc type array of property Drupal\\\\Tests\\\\one_time_password\\\\Functional\\\\UserLoginEnforceTest\\:\\:\\$modules is not covariant with PHPDoc type array\\<string\\> of overridden property Drupal\\\\Tests\\\\BrowserTestBase\\:\\:\\$modules\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Parameter \\#1 \\$account of method Drupal\\\\Tests\\\\BrowserTestBase\\:\\:drupalLogin\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#"
count: 1
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Parameter \\#1 \\$account of method Drupal\\\\Tests\\\\BrowserTestBase\\:\\:drupalUserIsLoggedIn\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#"
count: 3
path: tests/src/Functional/UserLoginEnforceTest.php
-
message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:\\$uri\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:getOneTimePassword\\(\\)\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:regenerateOneTimePassword\\(\\)\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Cannot call method getOneTimePassword\\(\\) on array\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Cannot call method getOneTimePassword\\(\\) on array\\<string, string\\>\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\ProvisioningUriItemTest\\:\\:testEmptyFieldItemListPasswordException\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\ProvisioningUriItemTest\\:\\:testEmptyFieldItemUriPasswordException\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\ProvisioningUriItemTest\\:\\:testRegenerateOneTimePassword\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^PHPDoc type array of property Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\ProvisioningUriItemTest\\:\\:\\$modules is not covariant with PHPDoc type array\\<string\\> of overridden property Drupal\\\\KernelTests\\\\KernelTestBase\\:\\:\\$modules\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Property Drupal\\\\entity_test\\\\Entity\\\\EntityTest\\:\\:\\$test_field \\(Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\) does not accept array\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Property Drupal\\\\entity_test\\\\Entity\\\\EntityTest\\:\\:\\$test_field \\(Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\) does not accept array\\<string, string\\>\\.$#"
count: 1
path: tests/src/Kernel/ProvisioningUriItemTest.php
-
message: "#^Access to an undefined property Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:\\$uri\\.$#"
count: 1
path: tests/src/Kernel/UserFieldAttachTest.php
-
message: "#^Call to an undefined method Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\:\\:regenerateOneTimePassword\\(\\)\\.$#"
count: 1
path: tests/src/Kernel/UserFieldAttachTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\UserFieldAttachTest\\:\\:testFieldAccess\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Kernel/UserFieldAttachTest.php
-
message: "#^Method Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\UserFieldAttachTest\\:\\:testUserAttachField\\(\\) has no return type specified\\.$#"
count: 1
path: tests/src/Kernel/UserFieldAttachTest.php
-
message: "#^PHPDoc type array of property Drupal\\\\Tests\\\\one_time_password\\\\Kernel\\\\UserFieldAttachTest\\:\\:\\$modules is not covariant with PHPDoc type array\\<string\\> of overridden property Drupal\\\\KernelTests\\\\KernelTestBase\\:\\:\\$modules\\.$#"
count: 1
path: tests/src/Kernel/UserFieldAttachTest.php
-
message: "#^Parameter \\#2 \\$account of method Drupal\\\\Core\\\\Access\\\\AccessibleInterface\\:\\:access\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface\\|null, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#"
count: 4
path: tests/src/Kernel/UserFieldAttachTest.php
-
message: "#^Parameter \\#2 \\$account of method Drupal\\\\Core\\\\Entity\\\\ContentEntityBase\\:\\:access\\(\\) expects Drupal\\\\Core\\\\Session\\\\AccountInterface\\|null, Drupal\\\\user\\\\Entity\\\\User\\|false given\\.$#"
count: 1
path: tests/src/Kernel/UserFieldAttachTest.php
includes:
- phpstan-baseline.neon
parameters:
level: max
paths:
- src
- tests
reportUnmatchedIgnoredErrors: true
checkMissingIterableValueType: false
......@@ -29,7 +29,7 @@ class ProvisioningUriItemList extends FieldItemList {
$password = TOTP::create();
$password->setLabel($this->getEntity()->label());
$this->list[0] = $this->createItem(0, [
'uri' => $password->getProvisioningUri()
'uri' => $password->getProvisioningUri(),
]);
}
......
......@@ -11,7 +11,6 @@ use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\user\Entity\User;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
......@@ -82,7 +82,7 @@ class UserLoginEnforce {
// Get the one time password object from the user and verify it against the
// one time password that was submitted. The flood table validation runs
// before this validation, so this is not a bruteforce vector. We only see
// before this validation, so this is not a brute-force vector. We only see
// this message if the user has successfully validated their password and
// have not tripped a flood threshold.
/** @var \OTPHP\TOTP $one_time_pass */
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\one_time_password\Functional;
use Drupal\Tests\BrowserTestBase;
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\one_time_password\Functional;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\user\Entity\User;
/**
......
<?php
declare(strict_types=1);
namespace Drupal\Tests\one_time_password\Functional;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\user\Traits\UserCreationTrait;
/**
* Test the actual process of logging in with TFA.
......@@ -49,7 +51,7 @@ class UserLoginEnforceTest extends BrowserTestBase {
$this->submitForm([
'name' => $test_user_with_tfa->getAccountName(),
'pass' => $test_user_with_tfa->passRaw,
], t('Log in'));
], 'Log in');
$this->assertSession()->pageTextContains('The entered two-factor authentication code is incorrect.');
// Attempt to login with an incorrect TFA code.
......@@ -58,7 +60,7 @@ class UserLoginEnforceTest extends BrowserTestBase {
'name' => $test_user_with_tfa->getAccountName(),
'pass' => $test_user_with_tfa->passRaw,
'one_time_password' => '123456',
], t('Log in'));
], 'Log in');
$this->assertSession()->pageTextContains('The entered two-factor authentication code is incorrect.');
// Attempt to login with the correct TFA code and ensure the user is
......@@ -68,7 +70,7 @@ class UserLoginEnforceTest extends BrowserTestBase {
'name' => $test_user_with_tfa->getAccountName(),
'pass' => $test_user_with_tfa->passRaw,
'one_time_password' => $otp_object->now(),
], t('Log in'));
], 'Log in');
$test_user_with_tfa->sessionId = $this->getSession()->getCookie($this->getSessionName());
$this->assertTrue($this->drupalUserIsLoggedIn($test_user_with_tfa), 'User was logged in successfully with a TFA code.');
}
......@@ -90,7 +92,7 @@ class UserLoginEnforceTest extends BrowserTestBase {
'name' => $test_user_with_tfa->getAccountName(),
'pass' => $test_user_with_tfa->passRaw,
'one_time_password' => $otp_object->at(time() - 195),
], t('Log in'));
], 'Log in');
$test_user_with_tfa->sessionId = $this->getSession()->getCookie($this->getSessionName());
$this->assertTrue($this->drupalUserIsLoggedIn($test_user_with_tfa), 'User was logged in successfully with a TFA code.');
......@@ -202,7 +204,7 @@ class UserLoginEnforceTest extends BrowserTestBase {
$this->drupalLogout();
}
// Atempt another valid login and ensure we can get authenticated.
// Attempt another valid login and ensure we can get authenticated.
$this->drupalGet('user/login');
$this->submitForm([
'name' => $tfa_user->getAccountName(),
......
......@@ -4,7 +4,6 @@ namespace Drupal\Tests\one_time_password\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\user\Entity\Role;
use Drupal\user\Entity\User;
/**
......@@ -62,7 +61,7 @@ class UserFieldAttachTest extends KernelTestBase {
// Ensure the user would normally have access to fields on the user.
$admin = $this->createUser(['administer users', 'access user profiles']);
$this->assertTrue($this->user->name->access('view', $admin));
$this->assertTrue($this->user->access('view', $admin));
// Ensure the one time password field is locked down from all operations.
$this->assertFalse($this->user->one_time_password->access('view', $admin));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment