ImceSourceTest.php in FileField Sources 8
File
tests/src/Functional/ImceSourceTest.php
View source
<?php
namespace Drupal\Tests\filefield_sources\Functional;
class ImceSourceTest extends FileFieldSourcesTestBase {
public static $modules = [
'imce',
];
protected function setUp() {
parent::setUp();
$this
->setUpImce();
}
public function testImceSourceEnabled() {
$this
->enableSources([
'imce' => TRUE,
]);
$file = $this
->createPermanentFileEntity();
$this
->uploadFileByImceSource($file
->getFileUri(), $file
->getFilename(), 0);
$this
->assertNoFieldByXPath('//input[@type="submit"]', t('Select'), t('After uploading a file, "Select" button is no longer displayed.'));
$this
->removeFile($file
->getFilename(), 0);
$this
->assertFieldByXpath('//input[@type="submit"]', t('Select'), 'After clicking the "Remove" button, the "Select" button is displayed.');
}
}