コード例 #1
0
ファイル: ProfilerTest.php プロジェクト: viesagroup/Prisma
 /**
  * @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);
 }
コード例 #2
0
 /**
  * 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();
 }