
| Current Path : /var/www/html/pallets_old/pallets/web/core/modules/views/tests/src/Kernel/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/pallets_old/pallets/web/core/modules/views/tests/src/Kernel/ViewsLegacyTest.php |
<?php
namespace Drupal\Tests\views\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\views\Plugin\views\cache\Time;
use Drupal\views\ViewExecutable;
use Symfony\Component\HttpFoundation\Request;
/**
* Tests deprecated views functionality.
*
* @group views
* @group legacy
*/
class ViewsLegacyTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['views'];
/**
* Tests the Time cache plugin.
*/
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
);
$view = $this->prophesize(ViewExecutable::class);
$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);
}
}