You are here

protected function ExternalTest::getPlugin in Freelinking 8.3

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/Plugin/freelinking/ExternalTest.php \Drupal\Tests\freelinking\Unit\Plugin\freelinking\ExternalTest::getPlugin()

Get plugin instance.

Parameters

bool $scrapeOption: The scrape option.

Return value

\Drupal\freelinking\Plugin\freelinking\External A plugin instance.

4 calls to ExternalTest::getPlugin()
ExternalTest::testBuildLink in tests/src/Unit/Plugin/freelinking/ExternalTest.php
Asserts that buildLink returns appropriate render array.
ExternalTest::testDefaultConfiguration in tests/src/Unit/Plugin/freelinking/ExternalTest.php
Asserts that default configuration is expected.
ExternalTest::testGetIndicator in tests/src/Unit/Plugin/freelinking/ExternalTest.php
Assert that the indicator is functional.
ExternalTest::testGetTip in tests/src/Unit/Plugin/freelinking/ExternalTest.php
Assert that getTip() is functional.

File

tests/src/Unit/Plugin/freelinking/ExternalTest.php, line 161

Class

ExternalTest
Tests the external plugin.

Namespace

Drupal\Tests\freelinking\Unit\Plugin\freelinking

Code

protected function getPlugin($scrapeOption = TRUE) {
  $configuration = [
    'settings' => [
      'scrape' => $scrapeOption,
    ],
  ];
  $plugin_definition = [
    'id' => 'external',
    'title' => 'External links',
    'hidden' => FALSE,
    'weight' => 0,
  ] + $configuration;
  return External::create($this->container, $configuration, 'external', $plugin_definition);
}