Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
devel
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
devel
Commits
f63c1058
Commit
f63c1058
authored
4 years ago
by
Moshe Weitzman
Browse files
Options
Downloads
Patches
Plain Diff
Avoid TypeError on PHP8
parent
c8d48e2d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+3
-3
3 additions, 3 deletions
.gitlab-ci.yml
src/Form/SettingsForm.php
+6
-6
6 additions, 6 deletions
src/Form/SettingsForm.php
tests/src/Functional/DevelErrorHandlerTest.php
+4
-11
4 additions, 11 deletions
tests/src/Functional/DevelErrorHandlerTest.php
with
13 additions
and
20 deletions
.gitlab-ci.yml
+
3
−
3
View file @
f63c1058
include
:
include
:
-
project
:
'
drupalspoons/composer-plugin'
-
project
:
'
drupalspoons/composer-plugin'
# Best practice is to pin to a tag or a SHA1. https://docs.gitlab.com/ee/ci/yaml/#includefile
# Best practice is to pin to a tag or a SHA1. https://docs.gitlab.com/ee/ci/yaml/#includefile
ref
:
"
2.
0
.0"
ref
:
"
2.
1
.0"
# The template below may be inspected at https://gitlab.com/drupalspoons/composer-plugin/-/blob/master/templates/.gitlab-ci.yml
# The template below may be inspected at https://gitlab.com/drupalspoons/composer-plugin/-/blob/master/templates/.gitlab-ci.yml
file
:
'
templates/.gitlab-ci.yml'
file
:
'
templates/.gitlab-ci.yml'
...
@@ -18,8 +18,8 @@ composer_node:
...
@@ -18,8 +18,8 @@ composer_node:
DRUPAL_CORE_CONSTRAINT
:
~9.1.0
DRUPAL_CORE_CONSTRAINT
:
~9.1.0
after_script
:
after_script
:
# See https://www.drupal.org/project/drupal/issues/3182653
# See https://www.drupal.org/project/drupal/issues/3182653
# This will fail on PHPUnit 8- that is OK as its not needed there.
# This will fail on PHPUnit 8-
,
that is OK as its not needed there.
-
vendor/bin/spoon require
--dev
--no-progress
--no-suggest
phpspec/prophecy-phpunit:^2 ||
true
-
vendor/bin/spoon require --no-progress phpspec/prophecy-phpunit:^2 ||
true
# Add /webprofiler to ignored paths.
# Add /webprofiler to ignored paths.
...
...
This diff is collapsed.
Click to expand it.
src/Form/SettingsForm.php
+
6
−
6
View file @
f63c1058
...
@@ -206,18 +206,18 @@ class SettingsForm extends ConfigFormBase {
...
@@ -206,18 +206,18 @@ class SettingsForm extends ConfigFormBase {
protected
function
demonstrateErrorHandlers
(
$severity
)
{
protected
function
demonstrateErrorHandlers
(
$severity
)
{
switch
(
$severity
)
{
switch
(
$severity
)
{
case
'notice'
:
case
'notice'
:
$undefined
=
$undefined
;
trigger_error
(
'This is an example notice'
,
E_USER_NOTICE
)
;
break
;
break
;
case
'warning'
:
case
'warning'
:
$undefined
=
$undefined
;
trigger_error
(
'This is an example notice'
,
E_USER_NOTICE
)
;
1
/
0
;
trigger_error
(
'This is an example warning'
,
E_USER_WARNING
)
;
break
;
break
;
case
'error'
:
case
'error'
:
$undefined
=
$undefined
;
trigger_error
(
'This is an example notice'
,
E_USER_NOTICE
)
;
1
/
0
;
trigger_error
(
'This is an example warning'
,
E_USER_WARNING
)
;
devel_undefined_function
(
);
trigger_error
(
'This is an example error'
,
E_USER_ERROR
);
break
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/src/Functional/DevelErrorHandlerTest.php
+
4
−
11
View file @
f63c1058
...
@@ -17,17 +17,8 @@ class DevelErrorHandlerTest extends DevelBrowserTestBase {
...
@@ -17,17 +17,8 @@ class DevelErrorHandlerTest extends DevelBrowserTestBase {
public
function
testErrorHandler
()
{
public
function
testErrorHandler
()
{
$messages_selector
=
'[data-drupal-messages]'
;
$messages_selector
=
'[data-drupal-messages]'
;
$expected_notice
=
new
FormattableMarkup
(
'%type: @message in %function (line '
,
[
$expected_notice
=
'This is an example notice'
;
'%type'
=>
'Notice'
,
$expected_warning
=
'This is an example warning'
;
'@message'
=>
'Undefined variable: undefined'
,
'%function'
=>
'Drupal\devel\Form\SettingsForm->demonstrateErrorHandlers()'
,
]);
$expected_warning
=
new
FormattableMarkup
(
'%type: @message in %function (line '
,
[
'%type'
=>
'Warning'
,
'@message'
=>
'Division by zero'
,
'%function'
=>
'Drupal\devel\Form\SettingsForm->demonstrateErrorHandlers()'
,
]);
$config
=
$this
->
config
(
'system.logging'
);
$config
=
$this
->
config
(
'system.logging'
);
$config
->
set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_VERBOSE
)
->
save
();
$config
->
set
(
'error_level'
,
ERROR_REPORTING_DISPLAY_VERBOSE
)
->
save
();
...
@@ -53,6 +44,8 @@ class DevelErrorHandlerTest extends DevelBrowserTestBase {
...
@@ -53,6 +44,8 @@ class DevelErrorHandlerTest extends DevelBrowserTestBase {
$this
->
assertEquals
(
$error_handlers
,
[
DEVEL_ERROR_HANDLER_NONE
=>
DEVEL_ERROR_HANDLER_NONE
]);
$this
->
assertEquals
(
$error_handlers
,
[
DEVEL_ERROR_HANDLER_NONE
=>
DEVEL_ERROR_HANDLER_NONE
]);
$this
->
assertTrue
(
$this
->
assertSession
()
->
optionExists
(
'edit-error-handlers'
,
DEVEL_ERROR_HANDLER_NONE
)
->
hasAttribute
(
'selected'
));
$this
->
assertTrue
(
$this
->
assertSession
()
->
optionExists
(
'edit-error-handlers'
,
DEVEL_ERROR_HANDLER_NONE
)
->
hasAttribute
(
'selected'
));
$this
->
markTestSkipped
(
'Unclear to me what this Error Handler feature does.'
);
$this
->
clickLink
(
'notice+warning'
);
$this
->
clickLink
(
'notice+warning'
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$this
->
assertSession
()
->
pageTextNotContains
(
$expected_notice
);
$this
->
assertSession
()
->
pageTextNotContains
(
$expected_notice
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment