You are here

protected function EmbeddedScheduledUpdateTypeTestBase::confirmNoAddForm in Scheduled Updates 8

Make sure Referenced types do not have a direct add form.

Parameters

string $label:

string $type_id:

Throws

\Drupal\Core\Entity\EntityStorageException

\Behat\Mink\Exception\ResponseTextException

1 call to EmbeddedScheduledUpdateTypeTestBase::confirmNoAddForm()
EmbeddedScheduledUpdateTypeTestBase::checkAfterTypeCreated in tests/src/FunctionalJavascript/EmbeddedScheduledUpdateTypeTestBase.php

File

tests/src/FunctionalJavascript/EmbeddedScheduledUpdateTypeTestBase.php, line 62
Contains \Drupal\Tests\scheduled_updates\EmbeddedScheduledUpdateTypeTestBase.

Class

EmbeddedScheduledUpdateTypeTestBase
Base test class for embedded update types.

Namespace

Drupal\Tests\scheduled_updates\FunctionalJavascript

Code

protected function confirmNoAddForm($label, $type_id) {
  $this
    ->loginWithPermissions([
    "create {$type_id} scheduled updates",
  ]);
  $this
    ->drupalGet('admin/content/scheduled-update/add');

  // 'Referenced type label does not appear on update add page.'
  $this
    ->assertSession()
    ->pageTextNotContains($label);

  // 'Update time field is not available on add page.'
  $this
    ->assertSession()
    ->pageTextNotContains('Update Date/time');
  $this
    ->checkAccessDenied('admin/content/scheduled-update/add/' . $type_id);
  $this
    ->loginLastUser();
}