You are here

protected function LinkitTestBase::createProfile in Linkit 8.4

Creates a profile based on default settings.

Parameters

array $settings: (optional) An associative array of settings for the profile, as used in entity_create(). Override the defaults by specifying the key and value in the array

The following defaults are provided:

  • label: Random string.

Return value

\Drupal\linkit\ProfileInterface The created profile entity.

7 calls to LinkitTestBase::createProfile()
AttributeCrudTest::setUp in src/Tests/AttributeCrudTest.php
Sets up a Drupal site for running functional and integration tests.
LinkitControllerTest::setUp in src/Tests/Controllers/LinkitControllerTest.php
Sets up a Drupal site for running functional and integration tests.
MatcherCrudTest::setUp in src/Tests/MatcherCrudTest.php
Sets up a Drupal site for running functional and integration tests.
MatcherCrudTest::testDelete in src/Tests/MatcherCrudTest.php
Test delete a matcher from a profile.
ProfileCrudTest::testOverview in src/Tests/ProfileCrudTest.php
Test the overview page.

... See full list

File

src/Tests/LinkitTestBase.php, line 70
Contains \Drupal\linkit\Tests\LinkitTestBase.

Class

LinkitTestBase
Sets up page and article content types.

Namespace

Drupal\linkit\Tests

Code

protected function createProfile(array $settings = []) {

  // Populate defaults array.
  $settings += [
    'id' => Unicode::strtolower($this
      ->randomMachineName()),
    'label' => $this
      ->randomMachineName(),
  ];
  $profile = Profile::create($settings);
  $profile
    ->save();
  return $profile;
}