You are here

protected function PanelizerTermFunctionalTest::createTerm in Panelizer 8.3

Create a term.

Return value

Term;

1 call to PanelizerTermFunctionalTest::createTerm()
PanelizerTermFunctionalTest::testPanelizerDefault in src/Tests/PanelizerTermFunctionalTest.php
Tests rendering a taxonomy term with Panelizer default.

File

src/Tests/PanelizerTermFunctionalTest.php, line 101

Class

PanelizerTermFunctionalTest
Basic functional tests of using Panelizer with taxonomy terms.

Namespace

Drupal\panelizer\Tests

Code

protected function createTerm() {
  $settings = [
    'description' => [
      [
        'value' => $this
          ->randomMachineName(32),
      ],
    ],
    'name' => $this
      ->randomMachineName(8),
    'vid' => 'tags',
    'uid' => \Drupal::currentUser()
      ->id(),
  ];
  $term = Term::create($settings);
  $term
    ->save();
  return $term;
}