public function BuiltinTest::testGetIndicator in Freelinking 4.0.x
Same name and namespace in other branches
- 8.3 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 87
Class
- BuiltinTest
- Tests the freelinking builtin plugin.
Namespace
Drupal\Tests\freelinking\Unit\Plugin\freelinkingCode
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));
}