Further modules included.
[yaffs-website] / web / modules / contrib / filefield_sources / src / Tests / RemoteSourceTest.php
1 <?php
2
3 /**
4  * @file
5  * Definition of Drupal\filefield_sources\Tests\RemoteSourceTest.
6  */
7
8 namespace Drupal\filefield_sources\Tests;
9
10 /**
11  * Tests the remote source.
12  *
13  * @group filefield_sources
14  */
15 class RemoteSourceTest extends FileFieldSourcesTestBase {
16
17   /**
18    * Tests remote source enabled.
19    */
20   public function testRemoteSourceEnabled() {
21     $this->enableSources(array(
22       'remote' => TRUE,
23     ));
24
25     // Upload a file by 'Remote' source.
26     $this->uploadFileByRemoteSource($GLOBALS['base_url'] . '/README.txt', 'README.txt', 0);
27
28     // We can only transfer one file on single value field.
29     $this->assertNoFieldByXPath('//input[@type="submit"]', t('Transfer'), t('After uploading a file, "Transfer" button is no longer displayed.'));
30
31     // Remove uploaded file.
32     $this->removeFile('README.txt', 0);
33
34     // Can transfer file again.
35     $this->assertFieldByXpath('//input[@type="submit"]', t('Transfer'), 'After clicking the "Remove" button, the "Transfer" button is displayed.');
36   }
37
38 }