You are here

public function RngEventTypeMappingFormTest::testMappingFormDeleted in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Tests/RngEventTypeMappingFormTest.php \Drupal\rng\Tests\RngEventTypeMappingFormTest::testMappingFormDeleted()
  2. 8 src/Tests/RngEventTypeMappingFormTest.php \Drupal\rng\Tests\RngEventTypeMappingFormTest::testMappingFormDeleted()

Test mapping form when a field does not exist.

File

src/Tests/RngEventTypeMappingFormTest.php, line 56

Class

RngEventTypeMappingFormTest
Tests RNG event type mapping form.

Namespace

Drupal\rng\Tests

Code

public function testMappingFormDeleted() {
  $url = $this->eventType
    ->toUrl('field-mapping');
  $this
    ->drupalGet($url);

  //$this->removeWhiteSpace();
  $this
    ->assertSession()
    ->responseContains('<td>Minimum registrants</td><td>Minimum number of registrants per registration.</td><td>Does not exist</td>');
  $this
    ->assertFieldById('edit-table-rng-registrants-minimum-operations-create', 'Create', "Create button exists for 'minimum registrants' field");

  // Test the field is added back.
  $this
    ->drupalPostForm($url, [], t('Create'));

  // $this->removeWhiteSpace();
  $this
    ->assertSession()
    ->responseContains('<td>Minimum registrants</td><td>Minimum number of registrants per registration.</td><td>Exists</td>');
  $this
    ->assertText('Field Minimum registrants added.');
}