FileCache example


  protected $staticFileCache;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->fileCache = new FileCache('prefix', 'test', '\Drupal\Tests\Component\FileCache\StaticFileCacheBackend', ['bin' => 'llama']);
    $this->staticFileCache = new StaticFileCacheBackend(['bin' => 'llama']);
  }

  /** * @covers ::get * @covers ::__construct */
  public function testGet() {
    // Test a cache miss.     $result = $this->fileCache->get(__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'no-llama-42.yml');
    $this->assertNull($result);

    
Home | Imprint | This part of the site doesn't use cookies.