You are here

protected function SoundCloudWidgetValidationTest::assertInvalidEntries in SoundCloud field 8

Asserts that invalid URLs cannot be submitted.

Parameters

array $invalidEntries: An array of invalid URL entries.

1 call to SoundCloudWidgetValidationTest::assertInvalidEntries()
SoundCloudWidgetValidationTest::testSoundCloudUrlInvalid in src/Tests/SoundCloudWidgetValidationTest.php
Test an invalid URLs or strings

File

src/Tests/SoundCloudWidgetValidationTest.php, line 126

Class

SoundCloudWidgetValidationTest
Test case for custom time field

Namespace

Drupal\soundcloudfield\Tests

Code

protected function assertInvalidEntries(array $invalidEntries) {
  foreach ($invalidEntries as $invalidValue => $errorMessage) {
    $edit = [
      "{$this->fieldName}[0][url]" => $invalidValue,
    ];
    $this
      ->drupalPostForm('entity_test/add', $edit, t('Save'));
    $this
      ->assertText(t($errorMessage, [
      '@link_path' => $invalidValue,
    ]));
  }
}