RefinableCacheableDependencyTraitTest.php
Same filename and directory in other branches
Namespace
Drupal\Tests\Core\CacheFile
-
core/
tests/ Drupal/ Tests/ Core/ Cache/ RefinableCacheableDependencyTraitTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\Core\Cache;
use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
use Drupal\Tests\UnitTestCase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
/**
* Tests the cache RefinableCacheableDependencyTrait.
*/
class RefinableCacheableDependencyTraitTest extends UnitTestCase implements RefinableCacheableDependencyInterface {
use RefinableCacheableDependencyTrait;
/**
* Tests non cacheable dependency add deprecation.
*/
public function testNonCacheableDependencyAddDeprecation() : void {
$this->expectDeprecation("Calling Drupal\\Core\\Cache\\RefinableCacheableDependencyTrait::addCacheableDependency() with an object that doesn't implement Drupal\\Core\\Cache\\CacheableDependencyInterface is deprecated in drupal:11.2.0 and is required in drupal:12.0.0. See https://www.drupal.org/node/3232020");
$this->addCacheableDependency(new \stdClass());
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| RefinableCacheableDependencyTraitTest | Tests the cache RefinableCacheableDependencyTrait. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.