You are here

protected function WorkspaceArchiveTest::deployThroughUi in Deploy - Content Staging 8

Deploy changes from source to target workspace via UI.

Parameters

\Drupal\multiversion\Entity\WorkspaceInterface $source:

\Drupal\multiversion\Entity\WorkspaceInterface $target:

array $edit:

Throws

\Behat\Mink\Exception\ResponseTextException

2 calls to WorkspaceArchiveTest::deployThroughUi()
WorkspaceArchiveTest::testTargetWorkspaceArchive in tests/src/Functional/WorkspaceArchiveTest.php
Tests archive of a target workspace.
WorkspaceArchiveTest::testWorkspaceArchive in tests/src/Functional/WorkspaceArchiveTest.php
Tests Workspace archive as part of deploy.

File

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

Class

WorkspaceArchiveTest
Tests workspace archive functionality.

Namespace

Drupal\Tests\deploy\Functional

Code

protected function deployThroughUi(WorkspaceInterface $source, WorkspaceInterface $target, array $edit = []) {
  $this
    ->switchToWorkspace($source);
  $this
    ->drupalGet('admin/structure/deployment/add');
  $this
    ->assertSession()
    ->pageTextContains('There are no conflicts.');
  $deployment = $edit + [
    'name[0][value]' => new FormattableMarkup('Deploy :source to :target', [
      ':source' => $source
        ->label(),
      ':target' => $target
        ->label(),
    ]),
  ];
  $this
    ->drupalPostForm('admin/structure/deployment/add', $deployment, new FormattableMarkup('Deploy to :target', [
    ':target' => $target
      ->label(),
  ]));
  \Drupal::service('cron')
    ->run();
  $this
    ->drupalGet('admin/structure/deployment');
  $this
    ->assertSession()
    ->pageTextContains($deployment['name[0][value]']);
}