public function HtmlLinkDetectorTest::testCreate in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 4.0.x tests/src/Unit/Plugin/RelatedEntitiesDetector/HtmlLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\HtmlLinkDetectorTest::testCreate()
- 3.5.x tests/src/Unit/Plugin/RelatedEntitiesDetector/HtmlLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\HtmlLinkDetectorTest::testCreate()
- 3.7.x tests/src/Unit/Plugin/RelatedEntitiesDetector/HtmlLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\HtmlLinkDetectorTest::testCreate()
- 3.8.x tests/src/Unit/Plugin/RelatedEntitiesDetector/HtmlLinkDetectorTest.php \Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetector\HtmlLinkDetectorTest::testCreate()
@covers ::create
File
- tests/
src/ Unit/ Plugin/ RelatedEntitiesDetector/ HtmlLinkDetectorTest.php, line 137
Class
- HtmlLinkDetectorTest
- Unit test for the html links entity detector plugin.
Namespace
Drupal\Tests\lingotek\Unit\Plugin\RelatedEntitiesDetectorCode
public function testCreate() {
$requestStack = $this
->createMock(RequestStack::class);
$requestStack
->expects($this
->any())
->method('getCurrentRequest')
->willReturn($this->request);
$container = $this
->createMock(ContainerInterface::class);
$container
->expects($this
->exactly(6))
->method('get')
->withConsecutive([
'entity.repository',
], [
'entity_field.manager',
], [
'lingotek.configuration',
], [
'request_stack',
], [
'entity_type.manager',
], [
'path.validator',
])
->willReturnOnConsecutiveCalls($this->entityRepository, $this->entityFieldManager, $this->lingotekConfiguration, $requestStack, $this->entityTypeManager, $this->pathValidator);
$detector = HtmlLinkDetector::create($container, [], 'html_link_detector', []);
$this
->assertNotNull($detector);
}