/**
* Tests that files stored in the root folder are converted properly.
*/
public function testConvertFileInRoot() { // Create the test image style with a Convert effect.
$image_style = ImageStyle::
create([ 'name' => 'image_effect_test',
'label' => 'Image Effect Test',
]);
$this->
assertEquals(SAVED_NEW,
$image_style->
save());
$image_style->
addImageEffect([ 'id' => 'image_convert',
'data' =>
[ 'extension' => 'jpeg',
],
]);
$this->
assertEquals(SAVED_UPDATED,
$image_style->
save());
// Create a copy of a test image file in root.
$test_uri = 'public://image-test-do.png';
\Drupal::
service('file_system'
)->
copy('core/tests/fixtures/files/image-test.png',
$test_uri, FileSystemInterface::EXISTS_REPLACE
);
$this->
assertFileExists($test_uri);