ClipboardSourceTest.php in FileField Sources 8
File
tests/src/Functional/ClipboardSourceTest.php
View source
<?php
namespace Drupal\Tests\filefield_sources\Functional;
class ClipboardSourceTest extends FileFieldSourcesTestBase {
public function testClipboardSourceEnabled() {
$this
->enableSources([
'clipboard' => TRUE,
]);
$file = $this
->createTemporaryFileEntity();
$this
->uploadFileByClipboardSource($file
->getFileUri(), $file
->getFilename(), 0);
$this
->assertNoFieldByXPath('//input[@type="submit"]', t('Upload'), t('After uploading a file, "Upload" button is no longer displayed.'));
$this
->removeFile($file
->getFilename(), 0);
$this
->assertFieldByXpath('//input[@type="submit"]', t('Upload'), 'After clicking the "Remove" button, the "Upload" button is displayed.');
}
}