From e5e61dc5666bc85b3f20a23d7b1bd38c30a20d86 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 19 Feb 2024 10:42:49 +0000 Subject: [PATCH] Issue #3309104 by Bhanu951, acbramley, mondrake, ravi.shankar, smustgrave, daffie, alexpott, quietone, mstrelan: Replace REQUEST_TIME in Functional and FunctionalJavascript tests --- .../Core/Test/FunctionalTestSetupTrait.php | 7 +- .../Functional/BlockContentRevisionsTest.php | 2 +- .../src/Functional/BlockContentSaveTest.php | 4 +- .../tests/src/Functional/CommentBlockTest.php | 2 +- .../Functional/CommentTranslationUITest.php | 2 +- .../Views/DefaultViewRecentCommentsTest.php | 2 +- .../ContentTranslationUITestBase.php | 2 +- .../src/Functional/DateTimeFieldTest.php | 8 +- .../dblog/tests/src/Functional/DbLogTest.php | 4 +- .../tests/src/Functional/FakeLogEntries.php | 2 +- .../tests/src/Functional/NestedFormTest.php | 4 +- .../src/Functional/FileFieldPathTest.php | 4 +- .../src/Functional/FileFieldRevisionTest.php | 4 +- .../tests/src/Functional/LocaleUpdateBase.php | 10 +- .../src/Functional/LocaleUpdateCronTest.php | 2 +- .../Functional/LocaleUpdateInterfaceTest.php | 4 +- .../tests/src/Functional/NodeAdminTest.php | 2 +- .../src/Functional/NodeRevisionsAllTest.php | 2 +- .../src/Functional/NodeRevisionsTest.php | 2 +- .../tests/src/Functional/NodeSaveTest.php | 4 +- .../src/Functional/NodeTranslationUITest.php | 2 +- .../src/Functional/Views/FrontPageTest.php | 2 +- .../Functional/Views/NodeIntegrationTest.php | 2 +- .../Views/Wizard/NodeRevisionWizardTest.php | 10 +- .../SearchMultilingualEntityTest.php | 2 +- .../src/Functional/SearchRankingTest.php | 4 +- .../src/Functional/StatisticsAdminTest.php | 6 +- .../src/Functional/System/CronRunTest.php | 2 +- .../tests/src/Functional/UserCreateTest.php | 4 +- .../tests/src/Functional/UserEditTest.php | 2 +- .../src/Functional/UserPasswordResetTest.php | 10 +- .../tests/src/Functional/UserPictureTest.php | 2 +- .../src/Functional/UserRegistrationTest.php | 2 +- .../src/Functional/Views/UserChangedTest.php | 2 +- .../src/Tests/AssertViewsCacheTagsTrait.php | 4 +- .../tests/src/Functional/BulkFormTest.php | 2 +- .../tests/src/Functional/DefaultViewsTest.php | 4 +- .../Functional/Wizard/ItemsPerPageTest.php | 12 +- .../tests/src/Functional/Wizard/PagerTest.php | 2 +- .../src/Functional/Wizard/SortingTest.php | 6 +- .../ClickSortingAJAXTest.php | 4 +- core/phpstan-baseline.neon | 205 ------------------ 42 files changed, 81 insertions(+), 283 deletions(-) diff --git a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php index fc4eed64cca..e2cfcbb07c9 100644 --- a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php +++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php @@ -264,9 +264,10 @@ trait FunctionalTestSetupTrait { $request = Request::create($request_path, 'GET', [], [], [], $server); $request->setSession(new Session(new MockArraySessionStorage())); - // Ensure the request time is REQUEST_TIME to ensure that API calls - // in the test use the right timestamp. - $request->server->set('REQUEST_TIME', REQUEST_TIME); + + // Ensure the request time is \Drupal::time()->getRequestTime() to ensure + // that API calls in the test use the right timestamp. + $request->server->set('REQUEST_TIME', \Drupal::time()->getRequestTime()); $this->container->get('request_stack')->push($request); // The request context is normally set by the router_listener from within diff --git a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php index 791cc78fba4..f0945995136 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php @@ -51,7 +51,7 @@ class BlockContentRevisionsTest extends BlockContentTestBase { $block->setNewRevision(TRUE); $block->setRevisionLogMessage($this->randomMachineName(32)); $block->setRevisionUser($this->adminUser); - $block->setRevisionCreationTime(REQUEST_TIME); + $block->setRevisionCreationTime(time()); $logs[] = $block->getRevisionLogMessage(); $block->save(); $blocks[] = $block->getRevisionId(); diff --git a/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php b/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php index 80c64b0674d..da58ed46309 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentSaveTest.php @@ -70,7 +70,9 @@ class BlockContentSaveTest extends BlockContentTestBase { public function testDeterminingChanges() { // Initial creation. $block = $this->createBlockContent('test_changes'); - $this->assertEquals(REQUEST_TIME, $block->getChangedTime(), 'Creating a block sets default "changed" timestamp.'); + // Creating a block should set the changed date to the current time + // which is always greater than the time set by hooks we're testing. + $this->assertGreaterThan(979534800, $block->getChangedTime(), 'Creating a block sets default "changed" timestamp.'); // Update the block without applying changes. $block->save(); diff --git a/core/modules/comment/tests/src/Functional/CommentBlockTest.php b/core/modules/comment/tests/src/Functional/CommentBlockTest.php index 7ff90332731..5a8dc9f9a86 100644 --- a/core/modules/comment/tests/src/Functional/CommentBlockTest.php +++ b/core/modules/comment/tests/src/Functional/CommentBlockTest.php @@ -50,7 +50,7 @@ class CommentBlockTest extends CommentTestBase { // Add some test comments, with and without subjects. Because the 10 newest // comments should be shown by the block, we create 11 to test that behavior // below. - $timestamp = REQUEST_TIME; + $timestamp = \Drupal::time()->getRequestTime(); for ($i = 0; $i < 11; ++$i) { $subject = ($i % 2) ? $this->randomMachineName() : ''; $comments[$i] = $this->postComment($this->node, $this->randomMachineName(), $subject); diff --git a/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php index 779700b44d3..202fd64ace5 100644 --- a/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php +++ b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php @@ -177,7 +177,7 @@ class CommentTranslationUITest extends ContentTranslationUITestBase { $user = $this->drupalCreateUser(); $values[$langcode] = [ 'uid' => $user->id(), - 'created' => REQUEST_TIME - mt_rand(0, 1000), + 'created' => \Drupal::time()->getRequestTime() - mt_rand(0, 1000), ]; /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ $date_formatter = $this->container->get('date.formatter'); diff --git a/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php index cd9145427a4..e55bd5e9421 100644 --- a/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php +++ b/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php @@ -99,7 +99,7 @@ class DefaultViewRecentCommentsTest extends ViewTestBase { $comment->comment_body->format = 'full_html'; // Ensure comments are sorted in ascending order. - $time = REQUEST_TIME + ($this->defaultDisplayResults - $i); + $time = \Drupal::time()->getRequestTime() + ($this->defaultDisplayResults - $i); $comment->setCreatedTime($time); $comment->changed->value = $time; diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php index c2035dcb2fb..570398aeca2 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php @@ -327,7 +327,7 @@ abstract class ContentTranslationUITestBase extends ContentTranslationTestBase { $user = $this->drupalCreateUser(); $values[$langcode] = [ 'uid' => $user->id(), - 'created' => REQUEST_TIME - mt_rand(0, 1000), + 'created' => \Drupal::time()->getRequestTime() - mt_rand(0, 1000), ]; $edit = [ 'content_translation[uid]' => $user->getAccountName(), diff --git a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php index 1dc86b6b9c5..1f670e65353 100644 --- a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php +++ b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php @@ -172,7 +172,7 @@ class DateTimeFieldTest extends DateTestBase { // has the same interval. Since the database always stores UTC, and the // interval will use this, force the test date to use UTC and not the local // or user timezone. - $timestamp = REQUEST_TIME - 87654321; + $timestamp = \Drupal::time()->getRequestTime() - 87654321; $entity = EntityTest::load($id); $field_name = $this->fieldStorage->getName(); $date = DrupalDateTime::createFromTimestamp($timestamp, 'UTC'); @@ -199,7 +199,7 @@ class DateTimeFieldTest extends DateTestBase { // has the same interval. Since the database always stores UTC, and the // interval will use this, force the test date to use UTC and not the local // or user timezone. - $timestamp = REQUEST_TIME + 87654321; + $timestamp = \Drupal::time()->getRequestTime() + 87654321; $entity = EntityTest::load($id); $field_name = $this->fieldStorage->getName(); $date = DrupalDateTime::createFromTimestamp($timestamp, 'UTC'); @@ -323,7 +323,7 @@ class DateTimeFieldTest extends DateTestBase { // has the same interval. Since the database always stores UTC, and the // interval will use this, force the test date to use UTC and not the local // or user timezone. - $timestamp = REQUEST_TIME - 87654321; + $timestamp = \Drupal::time()->getRequestTime() - 87654321; $entity = EntityTest::load($id); $field_name = $this->fieldStorage->getName(); $date = DrupalDateTime::createFromTimestamp($timestamp, 'UTC'); @@ -350,7 +350,7 @@ class DateTimeFieldTest extends DateTestBase { // has the same interval. Since the database always stores UTC, and the // interval will use this, force the test date to use UTC and not the local // or user timezone. - $timestamp = REQUEST_TIME + 87654321; + $timestamp = \Drupal::time()->getRequestTime() + 87654321; $entity = EntityTest::load($id); $field_name = $this->fieldStorage->getName(); $date = DrupalDateTime::createFromTimestamp($timestamp, 'UTC'); diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php index 9f5f2082539..9dc570befcb 100644 --- a/core/modules/dblog/tests/src/Functional/DbLogTest.php +++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -121,7 +121,7 @@ class DbLogTest extends BrowserTestBase { 'channel' => 'testing', 'link' => 'foo/bar', 'ip' => '0.0.1.0', - 'timestamp' => REQUEST_TIME, + 'timestamp' => \Drupal::time()->getRequestTime(), ]; \Drupal::service('logger.dblog')->log(RfcLogLevel::NOTICE, 'Test message', $context); $query = Database::getConnection()->select('watchdog'); @@ -630,7 +630,7 @@ class DbLogTest extends BrowserTestBase { 'request_uri' => $base_root . \Drupal::request()->getRequestUri(), 'referer' => \Drupal::request()->server->get('HTTP_REFERER'), 'ip' => '127.0.0.1', - 'timestamp' => REQUEST_TIME, + 'timestamp' => \Drupal::time()->getRequestTime(), ]; // Add a watchdog entry. $this->container->get('logger.dblog')->log($log['severity'], $log['message'], $log); diff --git a/core/modules/dblog/tests/src/Functional/FakeLogEntries.php b/core/modules/dblog/tests/src/Functional/FakeLogEntries.php index fa44d559392..23127c41acd 100644 --- a/core/modules/dblog/tests/src/Functional/FakeLogEntries.php +++ b/core/modules/dblog/tests/src/Functional/FakeLogEntries.php @@ -50,7 +50,7 @@ trait FakeLogEntries { 'request_uri' => $base_root . \Drupal::request()->getRequestUri(), 'referer' => \Drupal::request()->server->get('HTTP_REFERER'), 'ip' => '127.0.0.1', - 'timestamp' => REQUEST_TIME, + 'timestamp' => \Drupal::time()->getRequestTime(), ]; $logger = $this->container->get('logger.dblog'); diff --git a/core/modules/field/tests/src/Functional/NestedFormTest.php b/core/modules/field/tests/src/Functional/NestedFormTest.php index 0ce18389f94..89f60225837 100644 --- a/core/modules/field/tests/src/Functional/NestedFormTest.php +++ b/core/modules/field/tests/src/Functional/NestedFormTest.php @@ -217,11 +217,11 @@ class NestedFormTest extends FieldTestBase { // Display the 'combined form'. $this->drupalGet("test-entity-constraints/nested/{$entity_1->id()}/{$entity_2->id()}"); - $assert_session->hiddenFieldValueEquals('entity_2[changed]', (string) REQUEST_TIME); + $assert_session->hiddenFieldValueEquals('entity_2[changed]', (string) \Drupal::time()->getRequestTime()); // Submit the form and check that the entities are updated accordingly. $assert_session->hiddenFieldExists('entity_2[changed]') - ->setValue(REQUEST_TIME - 86400); + ->setValue(\Drupal::time()->getRequestTime() - 86400); $page->pressButton('Save'); $elements = $this->cssSelect('.entity-2.error'); diff --git a/core/modules/file/tests/src/Functional/FileFieldPathTest.php b/core/modules/file/tests/src/Functional/FileFieldPathTest.php index d706a38401a..6ea4e1341a3 100644 --- a/core/modules/file/tests/src/Functional/FileFieldPathTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldPathTest.php @@ -39,8 +39,8 @@ class FileFieldPathTest extends FileFieldTestBase { $date_formatter = $this->container->get('date.formatter'); $expected_filename = 'public://' . - $date_formatter->format(REQUEST_TIME, 'custom', 'Y') . '-' . - $date_formatter->format(REQUEST_TIME, 'custom', 'm') . '/' . + $date_formatter->format(\Drupal::time()->getRequestTime(), 'custom', 'Y') . '-' . + $date_formatter->format(\Drupal::time()->getRequestTime(), 'custom', 'm') . '/' . $test_file->getFilename(); $this->assertPathMatch($expected_filename, $node_file->getFileUri(), "The file {$node_file->getFileUri()} was uploaded to the correct path."); diff --git a/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php b/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php index 30ba2409b45..d2a68e9703e 100644 --- a/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php @@ -125,7 +125,7 @@ class FileFieldRevisionTest extends FileFieldTestBase { $connection = Database::getConnection(); $connection->update('file_managed') ->fields([ - 'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1), + 'changed' => \Drupal::time()->getRequestTime() - ($this->config('system.file')->get('temporary_maximum_age') + 1), ]) ->condition('fid', $node_file_r3->id()) ->execute(); @@ -143,7 +143,7 @@ class FileFieldRevisionTest extends FileFieldTestBase { // would set the timestamp. $connection->update('file_managed') ->fields([ - 'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1), + 'changed' => \Drupal::time()->getRequestTime() - ($this->config('system.file')->get('temporary_maximum_age') + 1), ]) ->condition('fid', $node_file_r1->id()) ->execute(); diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php index a3a2f6924c7..f2277a81ebe 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @@ -57,10 +57,10 @@ abstract class LocaleUpdateBase extends BrowserTestBase { parent::setUp(); // Setup timestamps to identify old and new translation sources. - $this->timestampOld = REQUEST_TIME - 300; - $this->timestampMedium = REQUEST_TIME - 200; - $this->timestampNew = REQUEST_TIME - 100; - $this->timestampNow = REQUEST_TIME; + $this->timestampOld = \Drupal::time()->getRequestTime() - 300; + $this->timestampMedium = \Drupal::time()->getRequestTime() - 200; + $this->timestampNew = \Drupal::time()->getRequestTime() - 100; + $this->timestampNow = \Drupal::time()->getRequestTime(); // Enable import of translations. By default this is disabled for automated // tests. @@ -111,7 +111,7 @@ abstract class LocaleUpdateBase extends BrowserTestBase { * in source and translations strings. */ protected function makePoFile($path, $filename, $timestamp = NULL, array $translations = []) { - $timestamp = $timestamp ? $timestamp : REQUEST_TIME; + $timestamp = $timestamp ? $timestamp : \Drupal::time()->getRequestTime(); $path = 'public://' . $path; $text = ''; $po_header = <<realpath($contrib_module_two_uri), REQUEST_TIME); + touch(\Drupal::service('file_system')->realpath($contrib_module_two_uri), \Drupal::time()->getRequestTime()); // Prepare for test: Simulate that the file has not been checked for a long // time. Set the last_check timestamp to zero. diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php index c1a561550d8..fabd5d90405 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php @@ -113,14 +113,14 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase { // Override Drupal core translation status as 'translations available'. $status = locale_translation_get_status(); $status['drupal']['de']->type = 'local'; - $status['drupal']['de']->files['local']->timestamp = REQUEST_TIME; + $status['drupal']['de']->files['local']->timestamp = \Drupal::time()->getRequestTime(); $status['drupal']['de']->files['local']->info['version'] = '8.1.1'; \Drupal::keyValue('locale.translation_status')->set('drupal', $status['drupal']); // Check if translations are available for Drupal core. $this->drupalGet('admin/reports/translations'); $this->assertSession()->pageTextContains('Updates for: Drupal core'); - $this->assertSession()->pageTextContains('Drupal core (' . $this->container->get('date.formatter')->format(REQUEST_TIME, 'html_date') . ')'); + $this->assertSession()->pageTextContains('Drupal core (' . $this->container->get('date.formatter')->format(\Drupal::time()->getRequestTime(), 'html_date') . ')'); $this->assertSession()->buttonExists('Update translations'); } diff --git a/core/modules/node/tests/src/Functional/NodeAdminTest.php b/core/modules/node/tests/src/Functional/NodeAdminTest.php index 6961f5bd5b5..7ce10cd348e 100644 --- a/core/modules/node/tests/src/Functional/NodeAdminTest.php +++ b/core/modules/node/tests/src/Functional/NodeAdminTest.php @@ -86,7 +86,7 @@ class NodeAdminTest extends NodeTestBase { public function testContentAdminSort() { $this->drupalLogin($this->adminUser); - $changed = REQUEST_TIME; + $changed = \Drupal::time()->getRequestTime(); $connection = Database::getConnection(); foreach (['dd', 'aa', 'DD', 'bb', 'cc', 'CC', 'AA', 'BB'] as $prefix) { $changed += 1000; diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php index 641fd709a05..ffad17c78fa 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php @@ -180,7 +180,7 @@ class NodeRevisionsAllTest extends NodeTestBase { // Set the revision timestamp to an older date to make sure that the // confirmation message correctly displays the stored revision date. - $old_revision_date = REQUEST_TIME - 86400; + $old_revision_date = \Drupal::time()->getRequestTime() - 86400; Database::getConnection()->update('node_revision') ->condition('vid', $nodes[2]->getRevisionId()) ->fields([ diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php index fd0e3332b2b..d0327c516fd 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php @@ -201,7 +201,7 @@ class NodeRevisionsTest extends NodeTestBase { // Set the revision timestamp to an older date to make sure that the // confirmation message correctly displays the stored revision date. - $old_revision_date = REQUEST_TIME - 86400; + $old_revision_date = \Drupal::time()->getRequestTime() - 86400; $connection->update('node_revision') ->condition('vid', $nodes[2]->getRevisionId()) ->fields([ diff --git a/core/modules/node/tests/src/Functional/NodeSaveTest.php b/core/modules/node/tests/src/Functional/NodeSaveTest.php index dd1060d0f65..5c209e8e839 100644 --- a/core/modules/node/tests/src/Functional/NodeSaveTest.php +++ b/core/modules/node/tests/src/Functional/NodeSaveTest.php @@ -95,8 +95,8 @@ class NodeSaveTest extends NodeTestBase { Node::create($edit)->save(); $node = $this->drupalGetNodeByTitle($edit['title']); - $this->assertEquals(REQUEST_TIME, $node->getCreatedTime(), 'Creating a node sets default "created" timestamp.'); - $this->assertEquals(REQUEST_TIME, $node->getChangedTime(), 'Creating a node sets default "changed" timestamp.'); + $this->assertEquals(\Drupal::time()->getRequestTime(), $node->getCreatedTime(), 'Creating a node sets default "created" timestamp.'); + $this->assertEquals(\Drupal::time()->getRequestTime(), $node->getChangedTime(), 'Creating a node sets default "changed" timestamp.'); // Store the timestamps. $created = $node->getCreatedTime(); diff --git a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php index c0d36ad1050..8e832e0bbc6 100644 --- a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php +++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php @@ -209,7 +209,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { $user = $this->drupalCreateUser(); $values[$langcode] = [ 'uid' => $user->id(), - 'created' => REQUEST_TIME - mt_rand(0, 1000), + 'created' => \Drupal::time()->getRequestTime() - mt_rand(0, 1000), 'sticky' => (bool) mt_rand(0, 1), 'promote' => (bool) mt_rand(0, 1), ]; diff --git a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php index 6ef860f7991..79d8b1ced51 100644 --- a/core/modules/node/tests/src/Functional/Views/FrontPageTest.php +++ b/core/modules/node/tests/src/Functional/Views/FrontPageTest.php @@ -92,7 +92,7 @@ class FrontPageTest extends ViewTestBase { $values['promote'] = TRUE; $values['status'] = TRUE; // Test descending sort order. - $values['created'] = REQUEST_TIME - $i; + $values['created'] = \Drupal::time()->getRequestTime() - $i; // Test the sticky order. if ($i == 5) { $values['sticky'] = TRUE; diff --git a/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php b/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php index ea0cfe411ac..e87399404d1 100644 --- a/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php +++ b/core/modules/node/tests/src/Functional/Views/NodeIntegrationTest.php @@ -34,7 +34,7 @@ class NodeIntegrationTest extends NodeTestBase { for ($j = 0; $j < 5; $j++) { // Ensure the right order of the nodes. - $node = $this->drupalCreateNode(['type' => $type->id(), 'created' => REQUEST_TIME - ($i * 5 + $j)]); + $node = $this->drupalCreateNode(['type' => $type->id(), 'created' => \Drupal::time()->getRequestTime() - ($i * 5 + $j)]); $nodes[$type->id()][$node->id()] = $node; $all_nids[] = $node->id(); } diff --git a/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php b/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php index 775ee5afe10..3b4a2cc7111 100644 --- a/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php +++ b/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php @@ -26,24 +26,24 @@ class NodeRevisionWizardTest extends WizardTestBase { // Create two nodes with two revision. $node_storage = \Drupal::entityTypeManager()->getStorage('node'); /** @var \Drupal\node\NodeInterface $node */ - $node = $node_storage->create(['title' => $this->randomString(), 'type' => 'article', 'changed' => REQUEST_TIME + 40]); + $node = $node_storage->create(['title' => $this->randomString(), 'type' => 'article', 'changed' => \Drupal::time()->getRequestTime() + 40]); $node->save(); $node = $node->createDuplicate(); $node->setNewRevision(); - $node->changed->value = REQUEST_TIME + 20; + $node->changed->value = \Drupal::time()->getRequestTime() + 20; $node->save(); - $node = $node_storage->create(['title' => $this->randomString(), 'type' => 'article', 'changed' => REQUEST_TIME + 30]); + $node = $node_storage->create(['title' => $this->randomString(), 'type' => 'article', 'changed' => \Drupal::time()->getRequestTime() + 30]); $node->save(); $node = $node->createDuplicate(); $node->setNewRevision(); - $node->changed->value = REQUEST_TIME + 10; + $node->changed->value = \Drupal::time()->getRequestTime() + 10; $node->save(); $this->drupalCreateContentType(['type' => 'not_article']); - $node = $node_storage->create(['title' => $this->randomString(), 'type' => 'not_article', 'changed' => REQUEST_TIME + 80]); + $node = $node_storage->create(['title' => $this->randomString(), 'type' => 'not_article', 'changed' => \Drupal::time()->getRequestTime() + 80]); $node->save(); $type = [ diff --git a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php index b6a939b0b83..89f1ef0fde0 100644 --- a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php +++ b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php @@ -228,7 +228,7 @@ class SearchMultilingualEntityTest extends BrowserTestBase { // The request time is always the same throughout test runs. Update the // request time to a previous time, to simulate it having been marked // previously. - $current = REQUEST_TIME; + $current = \Drupal::time()->getRequestTime(); $old = $current - 10; $connection = Database::getConnection(); $connection->update('search_dataset') diff --git a/core/modules/search/tests/src/Functional/SearchRankingTest.php b/core/modules/search/tests/src/Functional/SearchRankingTest.php index 7866af22e94..ff12e2b068e 100644 --- a/core/modules/search/tests/src/Functional/SearchRankingTest.php +++ b/core/modules/search/tests/src/Functional/SearchRankingTest.php @@ -77,7 +77,7 @@ class SearchRankingTest extends BrowserTestBase { 'title' => 'Drupal rocks', 'body' => [['value' => "Drupal's search rocks"]], // Node is one day old. - 'created' => REQUEST_TIME - 24 * 3600, + 'created' => \Drupal::time()->getRequestTime() - 24 * 3600, 'sticky' => 0, 'promote' => 0, ]; @@ -95,7 +95,7 @@ class SearchRankingTest extends BrowserTestBase { case 'recent': // Node is 1 hour hold. - $settings['created'] = REQUEST_TIME - 3600; + $settings['created'] = \Drupal::time()->getRequestTime() - 3600; break; case 'comments': diff --git a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php index d1504398692..2df822a1904 100644 --- a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php +++ b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php @@ -171,9 +171,9 @@ class StatisticsAdminTest extends BrowserTestBase { $this->assertSession()->pageTextContains('1 view'); // statistics_cron() will subtract - // statistics.settings:accesslog.max_lifetime config from REQUEST_TIME in - // the delete query, so wait two secs here to make sure the access log will - // be flushed for the node just hit. + // statistics.settings:accesslog.max_lifetime config from + // \Drupal::time()->getRequestTime() in the delete query, so wait two secs here to make + // sure the access log will be flushed for the node just hit. sleep(2); $this->cronRun(); diff --git a/core/modules/system/tests/src/Functional/System/CronRunTest.php b/core/modules/system/tests/src/Functional/System/CronRunTest.php index db7f15ee1a8..7d42b833617 100644 --- a/core/modules/system/tests/src/Functional/System/CronRunTest.php +++ b/core/modules/system/tests/src/Functional/System/CronRunTest.php @@ -54,7 +54,7 @@ class CronRunTest extends BrowserTestBase { /** * Ensure that the automated cron run module is working. * - * In these tests we do not use REQUEST_TIME to track start time, because we + * In these tests we do not use \Drupal::time()->getRequestTime() to track start time, because we * need the exact time when cron is triggered. */ public function testAutomatedCron() { diff --git a/core/modules/user/tests/src/Functional/UserCreateTest.php b/core/modules/user/tests/src/Functional/UserCreateTest.php index fc2e7f83a4c..61e408cb603 100644 --- a/core/modules/user/tests/src/Functional/UserCreateTest.php +++ b/core/modules/user/tests/src/Functional/UserCreateTest.php @@ -37,8 +37,8 @@ class UserCreateTest extends BrowserTestBase { $user = $this->drupalCreateUser(['administer users']); $this->drupalLogin($user); - $this->assertEquals(REQUEST_TIME, $user->getCreatedTime(), 'Creating a user sets default "created" timestamp.'); - $this->assertEquals(REQUEST_TIME, $user->getChangedTime(), 'Creating a user sets default "changed" timestamp.'); + $this->assertEquals(\Drupal::time()->getRequestTime(), $user->getCreatedTime(), 'Creating a user sets default "created" timestamp.'); + $this->assertEquals(\Drupal::time()->getRequestTime(), $user->getChangedTime(), 'Creating a user sets default "changed" timestamp.'); // Create a field. $field_name = 'test_field'; diff --git a/core/modules/user/tests/src/Functional/UserEditTest.php b/core/modules/user/tests/src/Functional/UserEditTest.php index 0db8950783d..88a2982d38d 100644 --- a/core/modules/user/tests/src/Functional/UserEditTest.php +++ b/core/modules/user/tests/src/Functional/UserEditTest.php @@ -92,7 +92,7 @@ class UserEditTest extends BrowserTestBase { $this->assertSame(1, (int) \Drupal::database()->select('sessions', 's')->countQuery()->execute()->fetchField()); // Make sure the changed timestamp is updated. - $this->assertEquals(REQUEST_TIME, $user1->getChangedTime(), 'Changing a user sets "changed" timestamp.'); + $this->assertEquals(\Drupal::time()->getRequestTime(), $user1->getChangedTime(), 'Changing a user sets "changed" timestamp.'); // Make sure the user can log in with their new password. $this->drupalLogout(); diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php index edc7308dfe9..c0a5d4844a6 100644 --- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php +++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php @@ -71,7 +71,7 @@ class UserPasswordResetTest extends BrowserTestBase { // Set the last login time that is used to generate the one-time link so // that it is definitely over a second ago. - $account->login = REQUEST_TIME - mt_rand(10, 100000); + $account->login = \Drupal::time()->getRequestTime() - mt_rand(10, 100000); Database::getConnection()->update('users_field_data') ->fields(['login' => $account->getLastLoginTime()]) ->condition('uid', $account->id()) @@ -175,7 +175,7 @@ class UserPasswordResetTest extends BrowserTestBase { // Create a password reset link as if the request time was 60 seconds older than the allowed limit. $timeout = $this->config('user.settings')->get('password_reset_timeout'); - $bogus_timestamp = REQUEST_TIME - $timeout - 60; + $bogus_timestamp = \Drupal::time()->getRequestTime() - $timeout - 60; $_uid = $this->account->id(); $this->drupalGet("user/reset/$_uid/$bogus_timestamp/" . user_pass_rehash($this->account, $bogus_timestamp)); $this->assertSession()->pageTextContains('You have tried to use a one-time login link that has expired. Request a new one using the form below.'); @@ -183,7 +183,7 @@ class UserPasswordResetTest extends BrowserTestBase { $this->assertSession()->pageTextContains('You have tried to use a one-time login link that has expired. Request a new one using the form below.'); // Create a user, block the account, and verify that a login link is denied. - $timestamp = REQUEST_TIME - 1; + $timestamp = \Drupal::time()->getRequestTime() - 1; $blocked_account = $this->drupalCreateUser()->block(); $blocked_account->save(); $this->drupalGet("user/reset/" . $blocked_account->id() . "/$timestamp/" . user_pass_rehash($blocked_account, $timestamp)); @@ -224,7 +224,7 @@ class UserPasswordResetTest extends BrowserTestBase { // Ensure blocked and deleted accounts can't access the user.reset.login // route. $this->drupalLogout(); - $timestamp = REQUEST_TIME - 1; + $timestamp = \Drupal::time()->getRequestTime() - 1; $blocked_account = $this->drupalCreateUser()->block(); $blocked_account->save(); $this->drupalGet("user/reset/" . $blocked_account->id() . "/$timestamp/" . user_pass_rehash($blocked_account, $timestamp) . '/login'); @@ -370,7 +370,7 @@ class UserPasswordResetTest extends BrowserTestBase { // Logged in users should not be able to access the user.reset.login or the // user.reset.form routes. - $timestamp = REQUEST_TIME - 1; + $timestamp = \Drupal::time()->getRequestTime() - 1; $this->drupalGet("user/reset/" . $this->account->id() . "/$timestamp/" . user_pass_rehash($this->account, $timestamp) . '/login'); $this->assertSession()->statusCodeEquals(403); $this->drupalGet("user/reset/" . $this->account->id()); diff --git a/core/modules/user/tests/src/Functional/UserPictureTest.php b/core/modules/user/tests/src/Functional/UserPictureTest.php index da7bc81beed..2ef3e92f690 100644 --- a/core/modules/user/tests/src/Functional/UserPictureTest.php +++ b/core/modules/user/tests/src/Functional/UserPictureTest.php @@ -90,7 +90,7 @@ class UserPictureTest extends BrowserTestBase { // would set the timestamp. Database::getConnection()->update('file_managed') ->fields([ - 'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1), + 'changed' => \Drupal::time()->getRequestTime() - ($this->config('system.file')->get('temporary_maximum_age') + 1), ]) ->condition('fid', $file->id()) ->execute(); diff --git a/core/modules/user/tests/src/Functional/UserRegistrationTest.php b/core/modules/user/tests/src/Functional/UserRegistrationTest.php index bd4d375b896..6d1c38df0f1 100644 --- a/core/modules/user/tests/src/Functional/UserRegistrationTest.php +++ b/core/modules/user/tests/src/Functional/UserRegistrationTest.php @@ -272,7 +272,7 @@ class UserRegistrationTest extends BrowserTestBase { $this->assertEquals($name, $new_user->getAccountName(), 'Username matches.'); $this->assertEquals($mail, $new_user->getEmail(), 'Email address matches.'); // Verify that the creation time is correct. - $this->assertGreaterThan(REQUEST_TIME - 20, $new_user->getCreatedTime()); + $this->assertGreaterThan(\Drupal::time()->getRequestTime() - 20, $new_user->getCreatedTime()); $this->assertEquals($config_user_settings->get('register') == UserInterface::REGISTER_VISITORS ? 1 : 0, $new_user->isActive(), 'Correct status field.'); $this->assertEquals($config_system_date->get('timezone.default'), $new_user->getTimezone(), 'Correct time zone field.'); $this->assertEquals(\Drupal::languageManager()->getDefaultLanguage()->getId(), $new_user->langcode->value, 'Correct language field.'); diff --git a/core/modules/user/tests/src/Functional/Views/UserChangedTest.php b/core/modules/user/tests/src/Functional/Views/UserChangedTest.php index 64beb93b4ac..976f8d41961 100644 --- a/core/modules/user/tests/src/Functional/Views/UserChangedTest.php +++ b/core/modules/user/tests/src/Functional/Views/UserChangedTest.php @@ -49,7 +49,7 @@ class UserChangedTest extends ViewTestBase { $this->drupalGet($path, $options); - $this->assertSession()->pageTextContains('Updated date: ' . date('Y-m-d', REQUEST_TIME)); + $this->assertSession()->pageTextContains('Updated date: ' . date('Y-m-d', \Drupal::time()->getRequestTime())); } } diff --git a/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php b/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php index d41a6dea939..f6dd19ed251 100644 --- a/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php +++ b/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php @@ -44,7 +44,7 @@ trait AssertViewsCacheTagsTrait { /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */ $request_stack = \Drupal::service('request_stack'); $request = Request::createFromGlobals(); - $request->server->set('REQUEST_TIME', REQUEST_TIME); + $request->server->set('REQUEST_TIME', \Drupal::time()->getRequestTime()); $request->setSession(new Session(new MockArraySessionStorage())); $view->setRequest($request); $request_stack->push($request); @@ -125,7 +125,7 @@ trait AssertViewsCacheTagsTrait { /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */ $request_stack = \Drupal::service('request_stack'); $request = new Request(); - $request->server->set('REQUEST_TIME', REQUEST_TIME); + $request->server->set('REQUEST_TIME', \Drupal::time()->getRequestTime()); $request->setSession(new Session(new MockArraySessionStorage())); $request_stack->push($request); $renderer->renderRoot($build); diff --git a/core/modules/views/tests/src/Functional/BulkFormTest.php b/core/modules/views/tests/src/Functional/BulkFormTest.php index a2cefcd7981..0d14f51fee5 100644 --- a/core/modules/views/tests/src/Functional/BulkFormTest.php +++ b/core/modules/views/tests/src/Functional/BulkFormTest.php @@ -43,7 +43,7 @@ class BulkFormTest extends BrowserTestBase { for ($i = 0; $i < 10; $i++) { // Ensure nodes are sorted in the same order they are inserted in the // array. - $timestamp = REQUEST_TIME - $i; + $timestamp = \Drupal::time()->getRequestTime() - $i; $nodes[] = $this->drupalCreateNode([ 'title' => 'Node ' . $i, 'sticky' => FALSE, diff --git a/core/modules/views/tests/src/Functional/DefaultViewsTest.php b/core/modules/views/tests/src/Functional/DefaultViewsTest.php index 6a6cb249af8..b39946a35b8 100644 --- a/core/modules/views/tests/src/Functional/DefaultViewsTest.php +++ b/core/modules/views/tests/src/Functional/DefaultViewsTest.php @@ -89,7 +89,7 @@ class DefaultViewsTest extends ViewTestBase { $this->createEntityReferenceField('node', 'page', $field_name, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); // Create a time in the past for the archive. - $time = REQUEST_TIME - 3600; + $time = \Drupal::time()->getRequestTime() - 3600; $this->addDefaultCommentField('node', 'page'); @@ -209,7 +209,7 @@ class DefaultViewsTest extends ViewTestBase { $columns = ['nid', 'created_year_month', 'num_records']; $column_map = array_combine($columns, $columns); // Create time of additional nodes created in the setup method. - $created_year_month = date('Ym', REQUEST_TIME - 3600); + $created_year_month = date('Ym', \Drupal::time()->getRequestTime() - 3600); $expected_result = [ [ 'nid' => 1, diff --git a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php index 67d3c38db83..c04ab600738 100644 --- a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php +++ b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php @@ -31,14 +31,14 @@ class ItemsPerPageTest extends WizardTestBase { // Create articles, each with a different creation time so that we can do a // meaningful sort. - $node1 = $this->drupalCreateNode(['type' => 'article', 'created' => REQUEST_TIME]); - $node2 = $this->drupalCreateNode(['type' => 'article', 'created' => REQUEST_TIME + 1]); - $node3 = $this->drupalCreateNode(['type' => 'article', 'created' => REQUEST_TIME + 2]); - $node4 = $this->drupalCreateNode(['type' => 'article', 'created' => REQUEST_TIME + 3]); - $node5 = $this->drupalCreateNode(['type' => 'article', 'created' => REQUEST_TIME + 4]); + $node1 = $this->drupalCreateNode(['type' => 'article', 'created' => \Drupal::time()->getRequestTime()]); + $node2 = $this->drupalCreateNode(['type' => 'article', 'created' => \Drupal::time()->getRequestTime() + 1]); + $node3 = $this->drupalCreateNode(['type' => 'article', 'created' => \Drupal::time()->getRequestTime() + 2]); + $node4 = $this->drupalCreateNode(['type' => 'article', 'created' => \Drupal::time()->getRequestTime() + 3]); + $node5 = $this->drupalCreateNode(['type' => 'article', 'created' => \Drupal::time()->getRequestTime() + 4]); // Create a page. This should never appear in the view created below. - $page_node = $this->drupalCreateNode(['type' => 'page', 'created' => REQUEST_TIME + 2]); + $page_node = $this->drupalCreateNode(['type' => 'page', 'created' => \Drupal::time()->getRequestTime() + 2]); // Create a view that sorts newest first, and shows 4 items in the page and // 3 in the block. diff --git a/core/modules/views/tests/src/Functional/Wizard/PagerTest.php b/core/modules/views/tests/src/Functional/Wizard/PagerTest.php index a3a3e34246c..29c6c64e17f 100644 --- a/core/modules/views/tests/src/Functional/Wizard/PagerTest.php +++ b/core/modules/views/tests/src/Functional/Wizard/PagerTest.php @@ -22,7 +22,7 @@ class PagerTest extends WizardTestBase { // conditions that are meaningful for the use of a pager. $this->drupalCreateContentType(['type' => 'page']); for ($i = 0; $i < 12; $i++) { - $this->drupalCreateNode(['created' => REQUEST_TIME - $i]); + $this->drupalCreateNode(['created' => \Drupal::time()->getRequestTime() - $i]); } // Make a View that uses a pager. diff --git a/core/modules/views/tests/src/Functional/Wizard/SortingTest.php b/core/modules/views/tests/src/Functional/Wizard/SortingTest.php index aa75f24139b..a2f959737a2 100644 --- a/core/modules/views/tests/src/Functional/Wizard/SortingTest.php +++ b/core/modules/views/tests/src/Functional/Wizard/SortingTest.php @@ -30,9 +30,9 @@ class SortingTest extends WizardTestBase { // Create nodes, each with a different creation time so that we can do a // meaningful sort. $this->drupalCreateContentType(['type' => 'page']); - $node1 = $this->drupalCreateNode(['created' => REQUEST_TIME]); - $node2 = $this->drupalCreateNode(['created' => REQUEST_TIME + 1]); - $node3 = $this->drupalCreateNode(['created' => REQUEST_TIME + 2]); + $node1 = $this->drupalCreateNode(['created' => \Drupal::time()->getRequestTime()]); + $node2 = $this->drupalCreateNode(['created' => \Drupal::time()->getRequestTime() + 1]); + $node3 = $this->drupalCreateNode(['created' => \Drupal::time()->getRequestTime() + 2]); // Create a view that sorts oldest first. $view1 = []; diff --git a/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php index 6ab5d105a85..b009ebdd07f 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php @@ -41,8 +41,8 @@ class ClickSortingAJAXTest extends WebDriverTestBase { // Create a Content type and two test nodes. $this->createContentType(['type' => 'page']); - $this->createNode(['title' => 'Page A', 'changed' => REQUEST_TIME]); - $this->createNode(['title' => 'Page B', 'changed' => REQUEST_TIME + 1000]); + $this->createNode(['title' => 'Page A', 'changed' => \Drupal::time()->getRequestTime()]); + $this->createNode(['title' => 'Page B', 'changed' => \Drupal::time()->getRequestTime() + 1000]); // Create a user privileged enough to view content. $user = $this->drupalCreateUser([ diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 0b725cb759b..123dd80f249 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -973,21 +973,11 @@ parameters: count: 1 path: modules/block_content/src/BlockContentTypeForm.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php - - message: "#^Variable \\$loaded might not be defined\\.$#" count: 9 path: modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/block_content/tests/src/Functional/BlockContentSaveTest.php - - message: "#^Variable \\$callable in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1038,11 +1028,6 @@ parameters: count: 1 path: modules/comment/src/Plugin/views/row/Rss.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/comment/tests/src/Functional/CommentBlockTest.php - - message: "#^Variable \\$position might not be defined\\.$#" count: 1 @@ -1058,16 +1043,6 @@ parameters: count: 1 path: modules/comment/tests/src/Functional/CommentTestBase.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/comment/tests/src/Functional/CommentTranslationUITest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php - - message: "#^Variable \\$data might not be defined\\.$#" count: 2 @@ -1128,11 +1103,6 @@ parameters: count: 1 path: modules/content_translation/src/Controller/ContentTranslationController.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php - - message: "#^Variable \\$unrestricted_tab_count might not be defined\\.$#" count: 1 @@ -1163,11 +1133,6 @@ parameters: count: 1 path: modules/datetime/src/Plugin/Validation/Constraint/DateTimeFormatConstraintValidator.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 4 - path: modules/datetime/tests/src/Functional/DateTimeFieldTest.php - - message: "#^Method Drupal\\\\datetime_range\\\\Plugin\\\\Field\\\\FieldType\\\\DateRangeFieldItemList\\:\\:defaultValuesForm\\(\\) should return array but return statement is missing\\.$#" count: 1 @@ -1193,16 +1158,6 @@ parameters: count: 1 path: modules/dblog/dblog.module - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 3 - path: modules/dblog/tests/src/Functional/DbLogTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/dblog/tests/src/Kernel/DbLogTest.php - - message: "#^Variable \\$items in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1213,11 +1168,6 @@ parameters: count: 1 path: modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/field/tests/src/Functional/NestedFormTest.php - - message: "#^Variable \\$values might not be defined\\.$#" count: 1 @@ -1288,16 +1238,6 @@ parameters: count: 1 path: modules/file/src/Plugin/Field/FieldType/FileFieldItemList.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/file/tests/src/Functional/FileFieldPathTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/file/tests/src/Functional/FileFieldRevisionTest.php - - message: "#^Variable \\$unexpected in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1498,21 +1438,6 @@ parameters: count: 1 path: modules/locale/src/StringDatabaseStorage.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 5 - path: modules/locale/tests/src/Functional/LocaleUpdateBase.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/locale/tests/src/Functional/LocaleUpdateCronTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php - - message: "#^Variable \\$error in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -1784,46 +1709,6 @@ parameters: count: 1 path: modules/node/src/Plugin/views/row/Rss.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/node/tests/src/Functional/NodeAdminTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/node/tests/src/Functional/NodeRevisionsAllTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/node/tests/src/Functional/NodeRevisionsTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/node/tests/src/Functional/NodeSaveTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/node/tests/src/Functional/NodeTranslationUITest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 3 - path: modules/node/tests/src/Functional/Views/FrontPageTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/node/tests/src/Functional/Views/NodeIntegrationTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 5 - path: modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php - - message: "#^Variable \\$changed in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -1947,16 +1832,6 @@ parameters: count: 1 path: modules/search/src/SearchPageRepository.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/search/tests/src/Functional/SearchMultilingualEntityTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/search/tests/src/Functional/SearchRankingTest.php - - message: "#^Call to an undefined method Drupal\\\\serialization\\\\Normalizer\\\\EntityNormalizer\\:\\:getCustomSerializedPropertyNames\\(\\)\\.$#" count: 1 @@ -2222,16 +2097,6 @@ parameters: count: 1 path: modules/user/src/RoleForm.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/user/tests/src/Functional/UserCreateTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/user/tests/src/Functional/UserEditTest.php - - message: "#^Variable \\$name in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -2242,31 +2107,11 @@ parameters: count: 1 path: modules/user/tests/src/Functional/UserLoginHttpTest.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 5 - path: modules/user/tests/src/Functional/UserPasswordResetTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/user/tests/src/Functional/UserPictureTest.php - - message: "#^Call to an undefined method Drupal\\\\Tests\\\\user\\\\Functional\\\\UserRegistrationRestTest\\:\\:getExpectedUnauthorizedEntityAccessCacheability\\(\\)\\.$#" count: 1 path: modules/user/tests/src/Functional/UserRegistrationRestTest.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/user/tests/src/Functional/UserRegistrationTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/user/tests/src/Functional/Views/UserChangedTest.php - - message: """ #^Call to deprecated method expectWarning\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\: @@ -2533,46 +2378,11 @@ parameters: count: 2 path: modules/views/tests/modules/views_test_data/views_test_data.views_execution.inc - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/views/tests/src/Functional/BulkFormTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/views/tests/src/Functional/DefaultViewsTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/views/tests/src/Functional/GlossaryTest.php - - message: "#^Variable \\$link might not be defined\\.$#" count: 1 path: modules/views/tests/src/Functional/TaxonomyGlossaryTest.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 6 - path: modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: modules/views/tests/src/Functional/Wizard/PagerTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 3 - path: modules/views/tests/src/Functional/Wizard/SortingTest.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php - - message: "#^Variable \\$rand1 might not be defined\\.$#" count: 2 @@ -2588,11 +2398,6 @@ parameters: count: 2 path: modules/views/tests/src/Kernel/Plugin/StyleTest.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 2 - path: modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php - - message: "#^Variable \\$relationship_handler in empty\\(\\) always exists and is not falsy\\.$#" count: 1 @@ -2867,16 +2672,6 @@ parameters: count: 1 path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php - - - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" - count: 1 - path: tests/Drupal/Tests/BrowserTestBase.php - - message: """ #^Call to deprecated method getConfig\\(\\) of class GuzzleHttp\\\\Client\\: