public function ExpiringCacheTest::testHasExpired

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Cache/ExpiringCacheTest.php, line 29

Class

ExpiringCacheTest

Namespace

Assetic\Test\Cache

Code

public function testHasExpired() {
  $key = 'asdf';
  $expiresKey = 'asdf.expires';
  $thePast = 0;
  $this->inner
    ->expects($this
    ->once())
    ->method('has')
    ->with($key)
    ->will($this
    ->returnValue(true));
  $this->inner
    ->expects($this
    ->once())
    ->method('get')
    ->with($expiresKey)
    ->will($this
    ->returnValue($thePast));
  $this->inner
    ->expects($this
    ->at(2))
    ->method('remove')
    ->with($expiresKey);
  $this->inner
    ->expects($this
    ->at(3))
    ->method('remove')
    ->with($key);
  $this
    ->assertFalse($this->cache
    ->has($key), '->has() returns false if an expired value exists');
}