You are here

protected function MigrateSearchPageTest::assertEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php \Drupal\Tests\search\Kernel\Migrate\d7\MigrateSearchPageTest::assertEntity()
  2. 9 core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php \Drupal\Tests\search\Kernel\Migrate\d7\MigrateSearchPageTest::assertEntity()

Asserts various aspects of a SearchPage entity.

@internal

Parameters

string $id: The expected search page ID.

string $path: The expected path of the search page.

bool $status: The expected status of the search page.

array $expected_config: An array of expected configuration for the search page.

3 calls to MigrateSearchPageTest::assertEntity()
MigrateSearchPageTest::testModuleExists in core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
Tests that search page is only migrated for modules enabled on D8 site.
MigrateSearchPageTest::testSearchPage in core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
Tests migration of search status and settings to search page entity.
MigrateSearchPageTest::testUserSearchCreate in core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php
Tests that a search page will be created if it does not exist.

File

core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php, line 37

Class

MigrateSearchPageTest
Tests migration of search page status and settings.

Namespace

Drupal\Tests\search\Kernel\Migrate\d7

Code

protected function assertEntity(string $id, string $path, bool $status = FALSE, array $expected_config = NULL) : void {

  /** @var \Drupal\search\Entity\SearchPage $search_page */
  $search_page = SearchPage::load($id);
  $this
    ->assertSame($id, $search_page
    ->id());
  $this
    ->assertSame($path, $search_page
    ->getPath());
  $this
    ->assertSame($status, $search_page
    ->status());
  if (isset($expected_config)) {
    $configuration = $search_page
      ->getPlugin()
      ->getConfiguration();
    $this
      ->assertSame($expected_config, $configuration);
  }
}