Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As part of #3049638-10: Replace call to deprecated function format_date the dateFormatter object was added to SchedulerBrowserTestBase.
This means that in test files we can change all ocurrences of
\Drupal::service('date.formatter')->format
to
$this->dateFormatter->format
There are four test files that can have this change:
SchedulerBasicTest.php
SchedulerPastDatesTest.php
SchedulerTokenReplaceTest.php
SchedulerValidationTest.php
Comment | File | Size | Author |
---|---|---|---|
#9 | scheduler-3054372-9.patch | 6.98 KB | kavbiswa |
|
Comments
Comment #2
kavbiswa CreditAttribution: kavbiswa at Infosys commentedI am working on this issue. will update the patch file with the changes.
Comment #3
shreyal999 CreditAttribution: shreyal999 as a volunteer and commentedHey, updated \Drupal::service('date.formatter')->format to $this->dateFormatter->format for all Functional Test's.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commented@shreyal999 please be curteous and if someone assigns the issue to themselves then let them work on it, and do not post a patch before they have made theirs.
Thank you
Jonathan (Scheduler maintainer)
Comment #5
kavbiswa CreditAttribution: kavbiswa at Infosys commentedThanks @jonathan1055 .
I have made the changes and attached the patch. Please review.
Let me know if any further change is needed for this.
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks kavbiswa. Just two minor changes required:
1) in tests/src/Functional/SchedulerBasicTest.php
can you add
$this->
in front ofdateFormatter
2) in tests/src/Functional/SchedulerTokenReplaceTest.php
instead of
just delete that line and use the new object directly in lines 59 and 60.
Thanks.
Comment #7
kavbiswa CreditAttribution: kavbiswa at Infosys commentedThanks @jonathan1055 for the inputs. I am working on the changes suggested.
Comment #8
kavbiswa CreditAttribution: kavbiswa at Infosys commentedComment #9
kavbiswa CreditAttribution: kavbiswa at Infosys commentedThanks @jonathan1055 for review and inputs on it.
I have made the suggested changes and have attached a patch file . Let me know if any further changes needs to be made.
Comment #11
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks kavbiswa, committed and creditted.
I made one small adjustment, to fix the new "line exceeds 80 chars" coding standard fault introduced with the longer comment.
Comment #12
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedComment #14
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedAdding parent