public function FileFieldSourcesTestBase::assertFileUploaded in FileField Sources 8
Check to see if file is uploaded.
Parameters
string $filename: File name.
int $delta: Delta in multiple values field.
6 calls to FileFieldSourcesTestBase::assertFileUploaded()
- FileFieldSourcesTestBase::uploadFileByAttachSource in tests/
src/ Functional/ FileFieldSourcesTestBase.php - Upload file by 'Attach' source.
- FileFieldSourcesTestBase::uploadFileByClipboardSource in tests/
src/ Functional/ FileFieldSourcesTestBase.php - Upload file by 'Clipboard' source.
- FileFieldSourcesTestBase::uploadFileByImceSource in tests/
src/ Functional/ FileFieldSourcesTestBase.php - Upload file by 'Imce' source.
- FileFieldSourcesTestBase::uploadFileByReferenceSource in tests/
src/ Functional/ FileFieldSourcesTestBase.php - Upload file by 'Reference' source.
- FileFieldSourcesTestBase::uploadFileByRemoteSource in tests/
src/ Functional/ FileFieldSourcesTestBase.php - Upload file by 'Remote' source.
File
- tests/
src/ Functional/ FileFieldSourcesTestBase.php, line 267
Class
- FileFieldSourcesTestBase
- Base class for File Field Sources test cases.
Namespace
Drupal\Tests\filefield_sources\FunctionalCode
public function assertFileUploaded($filename, $delta = 0) {
$this
->assertSession()
->linkExists($filename);
$xpath = '//input[@name="' . $this->fieldName . '_' . $delta . '_remove_button"]';
$fields = $this
->xpath($xpath);
foreach ($fields as $field) {
$this
->assertTrue($field
->getAttribute('value') == t('Remove'), 'After uploading a file, "Remove" button is displayed.');
}
}