Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thalles created an issue. See original summary.

Satyanarayan Reddy’s picture

Assigned: Unassigned » Satyanarayan Reddy
Status: Active » Needs review
FileSize
35.32 KB

Replace deprecated REQUEST_TIME

Status: Needs review » Needs work

The last submitted patch, 2: replace-deprecated-REQUEST_TIME-3032131-2.patch, failed testing. View results

Satyanarayan Reddy’s picture

Status: Needs work » Needs review
FileSize
33.65 KB

Time Service Added and REQUEST_TIME deprecated

thalles’s picture

Thanks for the patch!
I think we should expect the issue # 2705499 to be finalized.

Please make dependency injection when possible:
Only local images are allowed.

thalles’s picture

Status: Needs review » Needs work
Satyanarayan Reddy’s picture

Hi Thalles,
Any issue in this patch

thalles’s picture

Hi 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.

idebr’s picture

jonathan1055’s picture

The patch needs a re-roll. Also I think we should consider creating a property requestTime on SchedulerBrowserTestBase because the change affects 12 different test classes, all of which extend SchedulerBrowserTestBase. Does it make sense to do this once and use $this->requestTime in the tests, rather than call \Drupal::time()->getRequestTime() in each of the 12 test files?

idebr’s picture

  1. Rerolled #3 against 8.x-1.x
  2. Implemented dependency injection on \Drupal\scheduler\SchedulerManager
  3. Added the time service to \Drupal\Tests\scheduler\Functional\SchedulerBrowserTestBase
idebr’s picture

thalles’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
292.99 KB

Patch applied with success!

jonathan1055’s picture

Status: Reviewed & tested by the community » Postponed

Thanks. 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.

jonathan1055’s picture

Issue summary: View changes
Parent issue: » #3035104: [meta] Remove deprecated code flagged by @trigger_error messages for Drupal 9 compatibility

Linked to parent issue.

jonathan1055’s picture

idebr’s picture

Status: Needs work » Needs review
FileSize
36.17 KB

Rerolled against 8.x-1.x

jonathan1055’s picture

FileSize
36.23 KB

Needed a re-roll after recent commits.

Status: Needs review » Needs work

The last submitted patch, 18: 3032131-18.request_time.patch, failed testing. View results

jonathan1055’s picture

#19 was a random unrelated failure regarding mkdir()

jonathan1055’s picture

Assigned: Satyanarayan Reddy » jonathan1055
Status: Needs work » Needs review
FileSize
35.44 KB
24.51 KB

I 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->requestTime in 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.

jonathan1055’s picture

  • jonathan1055 committed f3b9aa2 on 8.x-1.x
    Issue #3032131 by jonathan1055, idebr, Satyanarayan Reddy, thalles:...
jonathan1055’s picture

Assigned: jonathan1055 » Unassigned
Status: Needs review » Fixed

Thanks idebr, Satyanarayan Reddy, thalles. Commited.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.