class AssetQueryStringTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Asset/AssetQueryStringTest.php \Drupal\KernelTests\Core\Asset\AssetQueryStringTest
  2. 10 core/tests/Drupal/KernelTests/Core/Asset/AssetQueryStringTest.php \Drupal\KernelTests\Core\Asset\AssetQueryStringTest

Tests the asset query string functionality.

Attributes

#[CoversClass(AssetQueryString::class)] #[Group('Asset')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of AssetQueryStringTest

File

core/tests/Drupal/KernelTests/Core/Asset/AssetQueryStringTest.php, line 17

Namespace

Drupal\KernelTests\Core\Asset
View source
class AssetQueryStringTest extends KernelTestBase {
  
  /**
   * Tests reset get.
   *
   * @legacy-covers ::get
   * @legacy-covers ::reset
   */
  public function testResetGet() : void {
    $state = $this->container
      ->get('state');
    // Return a fixed timestamp.
    $time = $this->createStub(TimeInterface::class);
    $time->method('getRequestTime')
      ->willReturn(1683246590);
    $queryString = new AssetQueryString($state, $time);
    $queryString->reset();
    $value = $queryString->get();
    $this->assertEquals('ru5tdq', $value);
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.