Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2019 at 13:20 UTC
Updated:
21 Apr 2019 at 15:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
satyanarayan reddy commentedReplace deprecated REQUEST_TIME
Comment #4
satyanarayan reddy commentedTime Service Added and REQUEST_TIME deprecated
Comment #5
thallesThanks for the patch!
I think we should expect the issue # 2705499 to be finalized.
Please make dependency injection when possible:

Comment #6
thallesComment #7
satyanarayan reddy commentedHi Thalles,
Any issue in this patch
Comment #8
thallesHi Satyanarayan,
I think we should expect the issue #2705499: Replace drupal_set_message() with an injectible service to be finalized and Drupal is asked for dependency injection.
Comment #9
idebr commentedClosed #3034226: Replace deprecated REQUEST_TIME on scheduler_api_test/scheduler_api_test.module as a duplicate issue.
Comment #10
jonathan1055 commentedThe patch needs a re-roll. Also I think we should consider creating a property
requestTimeonSchedulerBrowserTestBasebecause the change affects 12 different test classes, all of which extendSchedulerBrowserTestBase. Does it make sense to do this once and use$this->requestTimein the tests, rather than call\Drupal::time()->getRequestTime()in each of the 12 test files?Comment #11
idebr commented\Drupal\scheduler\SchedulerManager\Drupal\Tests\scheduler\Functional\SchedulerBrowserTestBaseComment #12
idebr commentedReroll after #3031199: Replace assertRaw(t()) with assertText() was committed.
Comment #13
thallesPatch applied with success!
Comment #14
jonathan1055 commentedThanks. However, the following two issues are more urgent as they are currently causing test failures in Travis.
#3034805: Using setPublished() with a $published parameter is deprecated in 8.3
#3034986: Replace deprecated SafeMarkup::checkPlain()
Both of these should be done first, so that we get clean test runs. Other patches may need a re-roll, so let's concentrate on these two before any others.
Comment #15
jonathan1055 commentedLinked to parent issue.
Comment #16
jonathan1055 commentedUn-postponing now that the following are in:
#3034805: Using setPublished() with a $published parameter is deprecated in 8.3
#3034986: Replace deprecated SafeMarkup::checkPlain()
Comment #17
idebr commentedRerolled against 8.x-1.x
Comment #18
jonathan1055 commentedNeeded a re-roll after recent commits.
Comment #20
jonathan1055 commented#19 was a random unrelated failure regarding
mkdir()Comment #21
jonathan1055 commentedI have simplified the testing code, rather than storing the time service and calling
$this->time->getRequestTime()every time, we now store the request time numeric value as a property of SchedulerBrowserTestBase via$this->requestTime = $this->container->get('datetime.time')->getRequestTime(). Then each test can simply use$this->requestTimein every place that we had$REQUEST_TIME@idebr I'd be interested to hear your opinion on this. The tests work, and it would appear to be more efficient than calling the method many times. I have not changed your code in SchedulerManager, only the tests.
The other (minor) change is in .module where the value is now stored and reused instead of calling the method three times.
Comment #22
jonathan1055 commentedRe-rolled patch #21 due to the commit in #2867271: assertEqual() is deprecated in Drupal 9. Replace with assertEquals()
Comment #24
jonathan1055 commentedThanks idebr, Satyanarayan Reddy, thalles. Commited.