Further modules included.
[yaffs-website] / web / modules / contrib / filefield_sources / src / Tests / ClipboardSourceTest.php
1 <?php
2
3 /**
4  * @file
5  * Definition of Drupal\filefield_sources\Tests\ClipboardSourceTest.
6  */
7
8 namespace Drupal\filefield_sources\Tests;
9
10 /**
11  * Tests the clipboard source.
12  *
13  * @group filefield_sources
14  */
15 class ClipboardSourceTest extends FileFieldSourcesTestBase {
16
17   /**
18    * Tests clipboard source enabled.
19    */
20   public function testClipboardSourceEnabled() {
21     $this->enableSources(array(
22       'clipboard' => TRUE,
23     ));
24     $file = $this->createTemporaryFileEntity();
25
26     $this->uploadFileByClipboardSource($file->getFileUri(), $file->getFilename(), 0);
27
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.'));
30
31     $this->removeFile($file->getFilename(), 0);
32
33     // Can upload file again.
34     $this->assertFieldByXpath('//input[@type="submit"]', t('Upload'), 'After clicking the "Remove" button, the "Upload" button is displayed.');
35   }
36
37 }