You are here

protected function TestHelperTrait::convertNameToMachineName in 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.

8 calls to TestHelperTrait::convertNameToMachineName()
IntegrationTest::addFacet in tests/src/Functional/IntegrationTest.php
Tests adding a facet trough the interface.
IntegrationTest::addFacetDuplicate in tests/src/Functional/IntegrationTest.php
Tests creating a facet with an existing machine name.
IntegrationTest::deleteUnusedFacet in tests/src/Functional/IntegrationTest.php
Deletes a facet through the UI.
IntegrationTest::deleteUsedFacet in tests/src/Functional/IntegrationTest.php
Deletes a facet through the UI that still has usages.
IntegrationTest::editFacet in tests/src/Functional/IntegrationTest.php
Tests editing of a facet through the UI.

... See full list

File

tests/src/Functional/TestHelperTrait.php, line 176

Class

TestHelperTrait
Adds helpers for test methods.

Namespace

Drupal\Tests\facets\Functional

Code

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