You are here

public function InlineEntityFormTest::testHostEntityWithoutModeration in Lightning Scheduler 8

File

tests/src/Functional/InlineEntityFormTest.php, line 118

Class

InlineEntityFormTest
@group lightning_scheduler

Namespace

Drupal\Tests\lightning_scheduler\Functional

Code

public function testHostEntityWithoutModeration() {
  $assert_session = $this
    ->assertSession();

  // Test with an un-moderated host entity.
  $this
    ->drupalGet('/user/' . $this->rootUser
    ->id() . '/edit');
  $assert_session
    ->statusCodeEquals(200);
  $inline_entity_form = $this
    ->assertInlineEntityForm();
  $inline_entity_form
    ->fillField('Title', 'Kaboom?');
  $assert_session
    ->selectExists('field_inline_entity[0][inline_entity_form][moderation_state][0][state]', $inline_entity_form);
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Save');
  $assert_session
    ->statusCodeEquals(200);
}