private function OptimizelyAliasIncludeSnippetTest::makePageAlias in Optimizely 8
Same name and namespace in other branches
- 8.3 src/Tests/OptimizelyAliasIncludeSnippetTest.php \Drupal\optimizely\Tests\OptimizelyAliasIncludeSnippetTest::makePageAlias()
- 8.0 src/Tests/OptimizelyAliasIncludeSnippetTest.php \Drupal\optimizely\Tests\OptimizelyAliasIncludeSnippetTest::makePageAlias()
Make a random alias to an existing page.
1 call to OptimizelyAliasIncludeSnippetTest::makePageAlias()
- OptimizelyAliasIncludeSnippetTest::testIncludeSnippet in src/
Tests/ OptimizelyAliasIncludeSnippetTest.php - Test inclusion and non-inclusion of snippet.
File
- src/
Tests/ OptimizelyAliasIncludeSnippetTest.php, line 141
Class
- OptimizelyAliasIncludeSnippetTest
- Tests pages that have aliases.
Namespace
Drupal\optimizely\TestsCode
private function makePageAlias($node) {
$edit_node = [];
$edit_node['source'] = '/node/' . $node
->id();
$edit_node['alias'] = '/' . $this
->randomMachineName(10);
$this
->drupalPostForm($this->addAliasPage, $edit_node, t('Save'));
// @todo create alias in 'node/add/page'
return $edit_node['alias'];
}