public function HtmlLinkDetectorTest::testCreate in Lingotek Translation 3.8.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.6.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()
@covers ::create
File
- tests/
src/ Unit/ Plugin/ RelatedEntitiesDetector/ HtmlLinkDetectorTest.php, line 157
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(7))
->method('get')
->withConsecutive([
'entity.repository',
], [
'entity_field.manager',
], [
'lingotek.configuration',
], [
'request_stack',
], [
'entity_type.manager',
], [
'path.validator',
], [
'stream_wrapper.public',
])
->willReturnOnConsecutiveCalls($this->entityRepository, $this->entityFieldManager, $this->lingotekConfiguration, $requestStack, $this->entityTypeManager, $this->pathValidator, $this->publicStream);
$detector = HtmlLinkDetector::create($container, [], 'html_link_detector', []);
$this
->assertNotNull($detector);
}