X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Ffilefield_sources%2Fsrc%2FTests%2FImceSourceTest.php;fp=web%2Fmodules%2Fcontrib%2Ffilefield_sources%2Fsrc%2FTests%2FImceSourceTest.php;h=5b0ea2cb0132ca44e2e6ff246ef44966cf85bdb0;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/filefield_sources/src/Tests/ImceSourceTest.php b/web/modules/contrib/filefield_sources/src/Tests/ImceSourceTest.php new file mode 100644 index 000000000..5b0ea2cb0 --- /dev/null +++ b/web/modules/contrib/filefield_sources/src/Tests/ImceSourceTest.php @@ -0,0 +1,52 @@ +setUpImce(); + } + + /** + * Tests imce source enabled. + */ + public function testImceSourceEnabled() { + $this->enableSources(array( + 'imce' => TRUE, + )); + $file = $this->createPermanentFileEntity(); + + $this->uploadFileByImceSource($file->getFileUri(), $file->getFilename(), 0); + + // We can only upload one file on single value field. + $this->assertNoFieldByXPath('//input[@type="submit"]', t('Select'), t('After uploading a file, "Select" button is no longer displayed.')); + + $this->removeFile($file->getFilename(), 0); + + // Can upload file again. + $this->assertFieldByXpath('//input[@type="submit"]', t('Select'), 'After clicking the "Remove" button, the "Select" button is displayed.'); + } + +}