You are here

private function BlockTest::createSearchPage in Search API Pages 8

Creates a search page.

Parameters

string $id: The page id.

string $label: The page label.

string $path: The page path.

int $indexId: The id of index to use.

Throws

\Behat\Mink\Exception\ExpectationException

1 call to BlockTest::createSearchPage()
BlockTest::setUp in tests/src/Functional/BlockTest.php

File

tests/src/Functional/BlockTest.php, line 44

Class

BlockTest
Provides web tests for Search API Pages.

Namespace

Drupal\Tests\search_api_page\Functional

Code

private function createSearchPage($id, $label, $path, $indexId) {
  $this
    ->drupalGet('admin/config/search/search-api-pages');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $step1 = [
    'label' => $label,
    'id' => $id,
    'index' => $indexId,
  ];
  $this
    ->drupalPostForm('admin/config/search/search-api-pages/add', $step1, 'Next');
  $step2 = [
    'path' => $path,
  ];
  $this
    ->drupalPostForm(NULL, $step2, 'Save');
}