TextOverlayUpdateTest.php in Image Effects 8
File
src/Tests/Update/TextOverlayUpdateTest.php
View source
<?php
namespace Drupal\image_effects\Tests\Update;
use Drupal\system\Tests\Update\UpdatePathTestBase;
class TextOverlayUpdateTest extends UpdatePathTestBase {
protected static $modules = [
'image_effects',
];
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../tests/fixtures/update/d_820_ie_810a2.php.gz',
];
}
public function testTextOverlayUpdate() {
$effect_data = $this
->config('image.style.test_text_overlay')
->get('effects.8287f632-3b1f-4a6f-926f-119550cc0948.data');
$this
->assertFalse(array_key_exists('maximum_chars', $effect_data['text']));
$this
->assertFalse(array_key_exists('excess_chars_text', $effect_data['text']));
$this
->assertFalse(array_key_exists('strip_tags', $effect_data['text']));
$this
->assertFalse(array_key_exists('decode_entities', $effect_data['text']));
$this
->runUpdates();
$effect_data = $this
->config('image.style.test_text_overlay')
->get('effects.8287f632-3b1f-4a6f-926f-119550cc0948.data');
$this
->assertTrue(array_key_exists('maximum_chars', $effect_data['text']));
$this
->assertNull($effect_data['text']['maximum_chars']);
$this
->assertTrue(array_key_exists('excess_chars_text', $effect_data['text']));
$this
->assertEqual('…', $effect_data['text']['excess_chars_text']);
$this
->assertTrue(array_key_exists('strip_tags', $effect_data['text']));
$this
->assertTrue($effect_data['text']['strip_tags']);
$this
->assertTrue(array_key_exists('decode_entities', $effect_data['text']));
$this
->assertTrue($effect_data['text']['decode_entities']);
}
}