diff --git a/core/modules/views/src/Plugin/views/cache/Time.php b/core/modules/views/src/Plugin/views/cache/Time.php index b801b0a30b..0cccb40493 100644 --- a/core/modules/views/src/Plugin/views/cache/Time.php +++ b/core/modules/views/src/Plugin/views/cache/Time.php @@ -48,7 +48,7 @@ class Time extends CachePluginBase { public function __construct(array $configuration, $plugin_id, $plugin_definition, DateFormatterInterface $date_formatter) { $this->dateFormatter = $date_formatter; if (func_num_args() == 5 && func_get_arg(4) instanceof Request) { - @trigger_error('The request object must not be passed to ' . __METHOD__ . '(). It is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016', E_USER_DEPRECATED); + @trigger_error('The request object must not be passed to ' . __METHOD__ . '(). It is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016', E_USER_DEPRECATED); } parent::__construct($configuration, $plugin_id, $plugin_definition); @@ -65,7 +65,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition */ public function __get($name) { if ($name === 'request') { - @trigger_error('The request property of ' . __CLASS__ . ' is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016', E_USER_DEPRECATED); + @trigger_error('The request property of ' . __CLASS__ . ' is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016', E_USER_DEPRECATED); return $this->view->getRequest(); } } diff --git a/core/modules/views/tests/src/Kernel/ViewsLegacyTest.php b/core/modules/views/tests/src/Kernel/ViewsLegacyTest.php index fae0441f49..a9b14e2d18 100644 --- a/core/modules/views/tests/src/Kernel/ViewsLegacyTest.php +++ b/core/modules/views/tests/src/Kernel/ViewsLegacyTest.php @@ -22,12 +22,10 @@ class ViewsLegacyTest extends KernelTestBase { /** * Tests the Time cache plugin. - * - * @expectedDeprecation The request object must not be passed to Drupal\views\Plugin\views\cache\Time::__construct(). It is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016 - * @expectedDeprecation The request property of Drupal\views\Plugin\views\cache\Time is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016 */ public function testTimeCache() { $request = Request::createFromGlobals(); + $this->expectDeprecation('The request object must not be passed to Drupal\views\Plugin\views\cache\Time::__construct(). It is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016'); $plugin = new Time([], 'time', \Drupal::service('plugin.manager.views.cache')->getDefinition('time'), \Drupal::service('date.formatter'), $request @@ -36,6 +34,7 @@ public function testTimeCache() { $view->getRequest()->willReturn($request); $plugin->view = $view->reveal(); $this->assertInstanceOf(Request::class, $plugin->request); + $this->expectDeprecation('The request property of Drupal\views\Plugin\views\cache\Time is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3154016'); $this->assertSame($request, $plugin->request); }