Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html1/rrr/web/core/tests/Drupal/Tests/Core/Cache/Context/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //var/www/html1/rrr/web/core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php

<?php

namespace Drupal\Tests\Core\Cache\Context;

use Drupal\Core\Cache\Context\IsFrontPathCacheContext;
use Drupal\Core\Path\PathMatcherInterface;
use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\Core\Cache\Context\IsFrontPathCacheContext
 * @group Cache
 */
class IsFrontPathCacheContextTest extends UnitTestCase {

  /**
   * @covers ::getContext
   */
  public function testGetContextFront() {
    $cache_context = new IsFrontPathCacheContext($this->createPathMatcher(TRUE)->reveal());
    $this->assertSame('is_front.1', $cache_context->getContext());
  }

  /**
   * @covers ::getContext
   */
  public function testGetContextNotFront() {
    $cache_context = new IsFrontPathCacheContext($this->createPathMatcher(FALSE)->reveal());
    $this->assertSame('is_front.0', $cache_context->getContext());
  }

  /**
   * Creates a PathMatcherInterface prophecy.
   *
   * @param bool $is_front
   *
   * @return \Prophecy\Prophecy\ObjectProphecy
   */
  protected function createPathMatcher($is_front) {
    $path_matcher = $this->prophesize(PathMatcherInterface::class);
    $path_matcher->isFrontPage()
      ->willReturn($is_front);

    return $path_matcher;
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net