2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Link;
27 $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\
Fluid\ViewHelpers\Link\ExternalViewHelper::class, array(
'renderChildren'));
29 $this->viewHelper->initializeArguments();
37 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
38 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'a');
39 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'href',
'http://www.some-domain.tld');
40 $mockTagBuilder->expects($this->once())->method(
'setContent')->with(
'some content');
41 $this->viewHelper->_set(
'tag', $mockTagBuilder);
43 $this->viewHelper->expects($this->any())->method(
'renderChildren')->will($this->returnValue(
'some content'));
45 $this->viewHelper->initialize();
46 $this->viewHelper->render(
'http://www.some-domain.tld');
54 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
55 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'a');
56 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'href',
'http://www.some-domain.tld');
57 $mockTagBuilder->expects($this->once())->method(
'setContent')->with(
'some content');
58 $this->viewHelper->_set(
'tag', $mockTagBuilder);
60 $this->viewHelper->expects($this->any())->method(
'renderChildren')->will($this->returnValue(
'some content'));
62 $this->viewHelper->initialize();
63 $this->viewHelper->render(
'www.some-domain.tld');
71 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
72 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'a');
73 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'href',
'ftp://some-domain.tld');
74 $mockTagBuilder->expects($this->once())->method(
'setContent')->with(
'some content');
75 $this->viewHelper->_set(
'tag', $mockTagBuilder);
77 $this->viewHelper->expects($this->any())->method(
'renderChildren')->will($this->returnValue(
'some content'));
79 $this->viewHelper->initialize();
80 $this->viewHelper->render(
'some-domain.tld',
'ftp');
88 $mockTagBuilder = $this->getMock(\TYPO3\CMS\
Fluid\Core\ViewHelper\TagBuilder::class, array(
'setTagName',
'addAttribute',
'setContent'));
89 $mockTagBuilder->expects($this->once())->method(
'setTagName')->with(
'a');
90 $mockTagBuilder->expects($this->once())->method(
'addAttribute')->with(
'href',
'some-domain.tld');
91 $mockTagBuilder->expects($this->once())->method(
'setContent')->with(
'some content');
92 $this->viewHelper->_set(
'tag', $mockTagBuilder);
94 $this->viewHelper->expects($this->any())->method(
'renderChildren')->will($this->returnValue(
'some content'));
96 $this->viewHelper->initialize();
97 $this->viewHelper->render(
'some-domain.tld',
'');