You are here

public function SchedulerFieldsDisplayTest::testManageFormDisplay in Scheduler 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SchedulerFieldsDisplayTest.php \Drupal\Tests\scheduler\Functional\SchedulerFieldsDisplayTest::testManageFormDisplay()

Tests the settings entry in the content type form display.

This test covers scheduler_entity_extra_field_info().

File

tests/src/Functional/SchedulerFieldsDisplayTest.php, line 133

Class

SchedulerFieldsDisplayTest
Tests the display of date entry fields and form elements.

Namespace

Drupal\Tests\scheduler\Functional

Code

public function testManageFormDisplay() {
  $this
    ->drupalLogin($this->adminUser2);

  // Check that the weight input field is displayed when the content type is
  // enabled for scheduling. This field still exists even with tabledrag on.
  $this
    ->drupalGet('admin/structure/types/manage/' . $this->type . '/form-display');
  $this
    ->assertSession()
    ->fieldExists('edit-fields-scheduler-settings-weight');

  // Check that the weight input field is not displayed when the content type
  // is not enabled for scheduling.
  $this->nodetype
    ->setThirdPartySetting('scheduler', 'publish_enable', FALSE)
    ->setThirdPartySetting('scheduler', 'unpublish_enable', FALSE)
    ->save();
  $this
    ->drupalGet('admin/structure/types/manage/' . $this->type . '/form-display');
  $this
    ->assertSession()
    ->FieldNotExists('edit-fields-scheduler-settings-weight');
}