You are here

private function OptimizelyIncludeSnippetTest::makePage in Optimizely 8

Same name and namespace in other branches
  1. 8.3 src/Tests/OptimizelyIncludeSnippetTest.php \Drupal\optimizely\Tests\OptimizelyIncludeSnippetTest::makePage()
  2. 8.0 src/Tests/OptimizelyIncludeSnippetTest.php \Drupal\optimizely\Tests\OptimizelyIncludeSnippetTest::makePage()

Make a page with a random title.

1 call to OptimizelyIncludeSnippetTest::makePage()
OptimizelyIncludeSnippetTest::testIncludeSnippet in src/Tests/OptimizelyIncludeSnippetTest.php
Test whether snippet is correctly included or not included.

File

src/Tests/OptimizelyIncludeSnippetTest.php, line 113

Class

OptimizelyIncludeSnippetTest
Test that the javascript snippet is included on project pages.

Namespace

Drupal\optimizely\Tests

Code

private function makePage() {
  $settings = [
    'type' => 'page',
    'title' => $this
      ->randomMachineName(32),
    'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
    'body' => [
      [
        'value' => $this
          ->randomMachineName(64),
        'format' => filter_default_format(),
      ],
    ],
  ];
  $node = $this
    ->drupalCreateNode($settings);
  return $node;
}