function MigrateSearchPageTest::assertEntity
Same name in other branches
- 9 core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php \Drupal\Tests\search\Kernel\Migrate\d7\MigrateSearchPageTest::assertEntity()
- 10 core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php \Drupal\Tests\search\Kernel\Migrate\d7\MigrateSearchPageTest::assertEntity()
- 11.x core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php \Drupal\Tests\search\Kernel\Migrate\d7\MigrateSearchPageTest::assertEntity()
Asserts various aspects of an SearchPage entity.
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 35
Class
- MigrateSearchPageTest
- Tests migration of search page status and settings.
Namespace
Drupal\Tests\search\Kernel\Migrate\d7Code
protected function assertEntity($id, $path, $status = FALSE, array $expected_config = NULL) {
/** @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);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.