You are here

protected function SoundCloudWidgetValidationTest::assertValidEntries in SoundCloud field 8

Asserts that valid URLs can be submitted.

Parameters

array $validEntries: An array of valid URL entries.

1 call to SoundCloudWidgetValidationTest::assertValidEntries()
SoundCloudWidgetValidationTest::testSoundCloudUrlValid in src/Tests/SoundCloudWidgetValidationTest.php
Test an a valid SoundCloud URL

File

src/Tests/SoundCloudWidgetValidationTest.php, line 107

Class

SoundCloudWidgetValidationTest
Test case for custom time field

Namespace

Drupal\soundcloudfield\Tests

Code

protected function assertValidEntries(array $validEntries) {
  foreach ($validEntries as $key => $validEntry) {
    $edit = [
      "{$this->fieldName}[0][url]" => $validEntry,
    ];
    $this
      ->drupalPostForm(NULL, $edit, t('Save'));
    preg_match('|entity_test/manage/(\\d+)|', $this->url, $match);
    $id = $match[1];
    $this
      ->assertText(t('entity_test @id has been created.', [
      '@id' => $id,
    ]));
    $this
      ->assertRaw($validEntry);
  }
}