public function TextimageTest::testTextimageCronRun in Textimage 8.3
Same name and namespace in other branches
- 8.4 tests/src/Functional/TextimageTest.php \Drupal\Tests\textimage\Functional\TextimageTest::testTextimageCronRun()
Test execution of Textimage cron hook.
File
- tests/
src/ Functional/ TextimageTest.php, line 164
Class
- TextimageTest
- Basic functionality of the Textimage module.
Namespace
Drupal\Tests\textimage\FunctionalCode
public function testTextimageCronRun() {
// Build a temporary textimage via API.
$textimage = $this->textimageFactory
->get();
$textimage
->setStyle(ImageStyle::load('textimage_test'))
->setTemporary(TRUE)
->process([
'text image for cron run',
])
->buildImage();
// Temp file should be created at location.
$this
->assertCount(1, file_scan_directory('public://textimage_store/temp', '/.*/'));
// Run cron.
$this
->cronRun();
// Temp directory should be removed.
$this
->assertDirectoryNotExists('public://textimage_store/temp');
}