2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;
36 $GLOBALS[
'TSFE']->cObj = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, array(), array(),
'',
false);
37 $this->viewHelper = $this->getMock($this->buildAccessibleProxy(\TYPO3\CMS\
Fluid\ViewHelpers\Link\EmailViewHelper::class), array(
'renderChildren'));
39 $this->viewHelper->initializeArguments();
47 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
48 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'a');
49 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'href',
'mailto:some@email.tld');
50 $mockTagBuilder->expects($this->once())->method(
'setContent')->with(
'some content');
51 $this->viewHelper->_set(
'tag', $mockTagBuilder);
52 $this->viewHelper->expects($this->any())->method(
'renderChildren')->will($this->returnValue(
'some content'));
53 $this->viewHelper->initialize();
54 $this->viewHelper->render(
'some@email.tld');
62 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
63 $mockTagBuilder->expects($this->once())->method(
'setContent')->with(
'some@email.tld');
64 $this->viewHelper->_set(
'tag', $mockTagBuilder);
65 $this->viewHelper->expects($this->any())->method(
'renderChildren')->will($this->returnValue(null));
66 $this->viewHelper->initialize();
67 $this->viewHelper->render(
'some@email.tld');