You are here

protected function LingotekNodeWhenFieldIsRemovedTest::removeField in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  2. 4.0.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  3. 3.0.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  4. 3.1.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  5. 3.3.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  6. 3.4.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  7. 3.5.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  8. 3.6.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  9. 3.7.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()
  10. 3.8.x tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeWhenFieldIsRemovedTest::removeField()

Removes a given field using the UI.

Parameters

string $entity_type_id: The entity type id.

string $bundle: The bundle.

$field_name: The field name.

1 call to LingotekNodeWhenFieldIsRemovedTest::removeField()
LingotekNodeWhenFieldIsRemovedTest::testFieldIsRemoved in tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php
Tests that we can translate after the field is removed.

File

tests/src/Functional/LingotekNodeWhenFieldIsRemovedTest.php, line 225

Class

LingotekNodeWhenFieldIsRemovedTest
Tests removing a field that was enabled for translation but it's not anymore.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function removeField($entity_type_id, $bundle, $field_name) {
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('/admin/structure/types/manage/article/fields');
  $assert_session
    ->linkByHrefExists("/admin/structure/types/manage/{$bundle}/fields/{$entity_type_id}.{$bundle}.{$field_name}/delete");
  $this
    ->drupalGet("/admin/structure/types/manage/{$bundle}/fields/{$entity_type_id}.{$bundle}.{$field_name}/delete");
  $this
    ->drupalPostForm(NULL, [], 'Delete');
}