You are here

protected function CoreViewsIntegrationTest::convertNameToMachineName in Core Views Facets 8

Convert facet name to machine name.

Parameters

string $facet_name: The name of the facet.

Return value

string The facet name changed to a machine name.

Overrides TestHelperTrait::convertNameToMachineName

5 calls to CoreViewsIntegrationTest::convertNameToMachineName()
CoreViewsIntegrationTest::addFacet in tests/src/Functional/CoreViewsIntegrationTest.php
Tests adding a facet trough the interface.
CoreViewsIntegrationTest::editFacet in tests/src/Functional/CoreViewsIntegrationTest.php
Tests editing of a facet through the UI.
CoreViewsIntegrationTest::goToDeleteFacetPage in tests/src/Functional/CoreViewsIntegrationTest.php
Go to the Delete Facet Page using the facet name.
CoreViewsIntegrationTest::setEmptyBehaviorFacetText in tests/src/Functional/CoreViewsIntegrationTest.php
Configures empty behavior option to show a text on empty results.
CoreViewsIntegrationTest::setOptionShowOnlyWhenFacetSourceVisible in tests/src/Functional/CoreViewsIntegrationTest.php
Configures a facet to only be visible when accessing to the facet source.

File

tests/src/Functional/CoreViewsIntegrationTest.php, line 363

Class

CoreViewsIntegrationTest
Tests the overall functionality of the Facets admin UI.

Namespace

Drupal\Tests\core_views_facets\Functional

Code

protected function convertNameToMachineName($facet_name) {
  return preg_replace('@[^a-zA-Z0-9_]+@', '_', strtolower($facet_name));
}