Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
typed_data
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
typed_data
Commits
c9e602b2
Commit
c9e602b2
authored
Mar 16, 2023
by
Tim Rohaly
Committed by
Tim Rohaly
Mar 16, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3348343
by TR: Replace assert* involving count() and an equality operator with assertCount()
parent
d0a258ed
No related branches found
No related tags found
1 merge request
!13
Resolve #3456818 "Remove outdated versioncompare"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/src/Functional/TypedDataFormWidget/TextareaWidgetTest.php
+1
-1
1 addition, 1 deletion
...src/Functional/TypedDataFormWidget/TextareaWidgetTest.php
tests/src/Kernel/TextDataTypeTest.php
+2
-2
2 additions, 2 deletions
tests/src/Kernel/TextDataTypeTest.php
with
3 additions
and
3 deletions
tests/src/Functional/TypedDataFormWidget/TextareaWidgetTest.php
+
1
−
1
View file @
c9e602b2
...
...
@@ -81,7 +81,7 @@ class TextareaWidgetTest extends FormWidgetBrowserTestBase {
->
setDescription
(
'Enter text, minimum 40 characters.'
);
// Omitting the 'allowEmptyString' argument in Symfony 4+ (which is used in
// Drupal 9.0+) gives a deprecation warning, but this option does not exist
// in
in
Symfony 6 (which is used in Drupal 10).
// in Symfony 6 (which is used in Drupal 10).
// @see https://www.drupal.org/project/typed_data/issues/3266222
if
(
version_compare
(
\Drupal
::
VERSION
,
'10.0'
,
'>='
))
{
$context_definition
->
addConstraint
(
'Length'
,
[
'min'
=>
40
]);
...
...
This diff is collapsed.
Click to expand it.
tests/src/Kernel/TextDataTypeTest.php
+
2
−
2
View file @
c9e602b2
...
...
@@ -37,11 +37,11 @@ class TextDataTypeTest extends KernelTestBase {
// Check basic get and set functionality.
$this
->
assertSame
(
$value
,
$typed_data
->
getValue
(),
'Text value was fetched.'
);
$this
->
assert
Equals
(
0
,
$typed_data
->
validate
()
->
count
()
);
$this
->
assert
Count
(
0
,
$typed_data
->
validate
());
$new_value
=
$this
->
randomString
()
.
"
\r\n
"
.
$this
->
randomString
();
$typed_data
->
setValue
(
$new_value
);
$this
->
assertSame
(
$new_value
,
$typed_data
->
getValue
(),
'Text value was changed.'
);
$this
->
assert
Equals
(
0
,
$typed_data
->
validate
()
->
count
()
);
$this
->
assert
Count
(
0
,
$typed_data
->
validate
());
}
}
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