You are here

public function ImageStyleWarmerGeneralTest::testImageStyleWarmerQueuePermanentImageFile in Image Style Warmer 8

Test Image Style Warmer queue warming for permanent file.

File

tests/src/Functional/ImageStyleWarmerGeneralTest.php, line 77

Class

ImageStyleWarmerGeneralTest
Functional tests to check general function of Image Style Warmer.

Namespace

Drupal\Tests\image_style_warmer\Functional

Code

public function testImageStyleWarmerQueuePermanentImageFile() {
  $this
    ->prepareImageStyleWarmerTests(TRUE);
  $this
    ->assertSame(1, $this->testQueue
    ->numberOfItems(), 'Image Style Warmer Pregenerator queue should not be empty.');
  $this
    ->assertTrue(file_exists($this->testInitialStyle
    ->buildUri($this->testFile
    ->getFileUri())), 'Generated file does exist.');
  $this
    ->assertFalse(file_exists($this->testQueueStyle
    ->buildUri($this->testFile
    ->getFileUri())), 'Generated file does not exist.');
  $this
    ->cronRun();
  $this
    ->assertSame(0, $this->testQueue
    ->numberOfItems(), 'Image Style Warmer Pregenerator queue should be empty.');
  $this
    ->assertTrue(file_exists($this->testQueueStyle
    ->buildUri($this->testFile
    ->getFileUri())), 'Generated file does exist.');
}