Example #1
0
 /**
  * @test
  */
 public function renderSetsTagContentToEmailIfRenderChildrenReturnNull()
 {
     //$GLOBALS['TSFE']->cObj->expects($this->once())->method('getMailTo')->with('*****@*****.**', '*****@*****.**')->will($this->returnValue(array('mailto:some@email.tld', '*****@*****.**')));
     $mockTagBuilder = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\TagBuilder', array('setTagName', 'addAttribute', 'setContent'));
     $mockTagBuilder->expects($this->once())->method('setContent')->with('*****@*****.**');
     $this->viewHelper->_set('tag', $mockTagBuilder);
     $this->viewHelper->expects($this->any())->method('renderChildren')->will($this->returnValue(NULL));
     $this->viewHelper->initialize();
     $this->viewHelper->render('*****@*****.**');
 }
 /**
  * @test
  */
 public function renderDoesNotAddEmptyScheme()
 {
     $mockTagBuilder = $this->createMock(\TYPO3\Fluid\Core\ViewHelper\TagBuilder::class, array('setTagName', 'addAttribute', 'setContent'));
     $mockTagBuilder->expects($this->once())->method('setTagName')->with('a');
     $mockTagBuilder->expects($this->once())->method('addAttribute')->with('href', 'some-domain.tld');
     $mockTagBuilder->expects($this->once())->method('setContent')->with('some content');
     $this->viewHelper->_set('tag', $mockTagBuilder);
     $this->viewHelper->expects($this->any())->method('renderChildren')->will($this->returnValue('some content'));
     $this->viewHelper->initialize();
     $this->viewHelper->render('some-domain.tld', '');
 }