5 * Definition of Drupal\filefield_sources\Tests\ClipboardSourceTest.
8 namespace Drupal\filefield_sources\Tests;
11 * Tests the clipboard source.
13 * @group filefield_sources
15 class ClipboardSourceTest extends FileFieldSourcesTestBase {
18 * Tests clipboard source enabled.
20 public function testClipboardSourceEnabled() {
21 $this->enableSources(array(
24 $file = $this->createTemporaryFileEntity();
26 $this->uploadFileByClipboardSource($file->getFileUri(), $file->getFilename(), 0);
28 // We can only upload one file on single value field.
29 $this->assertNoFieldByXPath('//input[@type="submit"]', t('Upload'), t('After uploading a file, "Upload" button is no longer displayed.'));
31 $this->removeFile($file->getFilename(), 0);
33 // Can upload file again.
34 $this->assertFieldByXpath('//input[@type="submit"]', t('Upload'), 'After clicking the "Remove" button, the "Upload" button is displayed.');