You are here

public function AttachSourceTest::assertCanNotAttachFile in FileField Sources 8

Check to see if can attach file.

Parameters

object $file: File to attach.

1 call to AttachSourceTest::assertCanNotAttachFile()
AttachSourceTest::fileCanBeUploadAndDeleted in tests/src/Functional/AttachSourceTest.php

File

tests/src/Functional/AttachSourceTest.php, line 128

Class

AttachSourceTest
Tests the attach source.

Namespace

Drupal\Tests\filefield_sources\Functional

Code

public function assertCanNotAttachFile($file) {

  // Ensure option is not present.
  $this
    ->assertFalse($this
    ->isOptionPresent($file->uri), 'File option is not present.');

  // Ensure empty message is present.
  $this
    ->assertText('There currently are no files to attach.', "Empty message is present.");

  // Attach button is always present.
  $this
    ->assertFieldByXpath('//input[@type="submit"]', t('Attach'), 'Attach button is present.');
}