You are here

public function BuiltinTest::testGetIndicator in Freelinking 8.3

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

Asserts that getIndicator pattern is functional for all patterns.

@dataProvider getIndicatorProvider

Parameters

string $indicator: The indicator to test.

int $expected: The expected output from preg_match.

File

tests/src/Unit/Plugin/freelinking/BuiltinTest.php, line 84

Class

BuiltinTest
Tests the freelinking builtin plugin.

Namespace

Drupal\Tests\freelinking\Unit\Plugin\freelinking

Code

public function testGetIndicator($indicator, $expected) {
  $accountProphet = $this
    ->prophesize('\\Drupal\\Core\\Session\\AccountProxyInterface');
  $plugin = new Builtin($this->configuration, $this->id, $this->definition, $accountProphet
    ->reveal());
  $this
    ->assertEquals($expected, preg_match($plugin
    ->getIndicator(), $indicator));
}