You are here

public function RemoteStreamWrapperWidgetTest::testRegression3043148 in Remote stream wrapper widget 8

Tests that the site does not crash when the field is left empty.

File

tests/src/Functional/RemoteStreamWrapperWidgetTest.php, line 113

Class

RemoteStreamWrapperWidgetTest
Tests the Remote Stream Wrapper Widget.

Namespace

Drupal\Tests\remote_stream_wrapper_widget\Functional

Code

public function testRegression3043148() {
  $nodeTitle = $this
    ->randomString();
  $values = [
    'title[0][value]' => $nodeTitle,
    "{$this->fieldName}[0][url]" => '',
  ];
  $this
    ->getSession()
    ->visit("/node/add/{$this->contentType->id()}");
  $this
    ->assertSame(200, $this
    ->getSession()
    ->getStatusCode());
  $this
    ->submitForm($values, 'Save');
  $this
    ->assertSame(200, $this
    ->getSession()
    ->getStatusCode());
  $this
    ->assertSession()
    ->pageTextContains($nodeTitle);
  $this
    ->assertSession()
    ->pageTextNotContains($this->fieldName);
}