示例#1
0
 /**
  * @covers  \Joomla\Profiler\Profiler::__toString
  * @uses    \Joomla\Profiler\Profiler::setRenderer
  */
 public function testTheProfilerCanBeCastToAString()
 {
     $mockedRenderer = $this->getMock('\\Joomla\\Profiler\\ProfilerRendererInterface');
     $mockedRenderer->expects($this->once())->method('render')->with($this->instance)->willReturn('Rendered profile');
     $this->instance->setRenderer($mockedRenderer);
     $this->assertSame('Rendered profile', (string) $this->instance);
 }
 /**
  * Tests the __toString method.
  *
  * @return  void
  *
  * @covers  \Joomla\Profiler\Profiler::__toString
  * @since   1.0
  */
 public function test__toString()
 {
     $mockedRenderer = $this->getMock('\\Joomla\\Profiler\\ProfilerRendererInterface');
     $mockedRenderer->expects($this->once())->method('render')->with($this->instance);
     $this->instance->setRenderer($mockedRenderer);
     $this->instance->__toString();
 }