public function testDisplay() { $profilerOutputOne = $this->getMockForAbstractClass('Magento_Profiler_OutputAbstract'); $profilerOutputOne->expects($this->exactly(2))->method('display'); $profilerOutputTwo = $this->getMockForAbstractClass('Magento_Profiler_OutputAbstract'); $profilerOutputTwo->expects($this->once())->method('display'); Magento_Profiler::registerOutput($profilerOutputOne); Magento_Profiler::display(); Magento_Profiler::disable(); Magento_Profiler::registerOutput($profilerOutputTwo); Magento_Profiler::display(); }
public function testDisabledProfiler() { $driver = $this->_getDriverMock(); $driver->expects($this->never())->method('start'); $driver->expects($this->never())->method('stop'); Magento_Profiler::add($driver); Magento_Profiler::disable(); Magento_Profiler::start('test'); Magento_Profiler::stop('test'); }
/** * Test display method */ public function testDisplayAndRegisterOutput() { $outputOne = $this->getMock('Magento_Profiler_Driver_Standard_OutputInterface'); $outputOne->expects($this->once())->method('display')->with($this->_stat); $outputTwo = $this->getMock('Magento_Profiler_Driver_Standard_OutputInterface'); $outputTwo->expects($this->once())->method('display')->with($this->_stat); $this->_driver->registerOutput($outputOne); $this->_driver->registerOutput($outputTwo); Magento_Profiler::enable(); $this->_driver->display(); Magento_Profiler::disable(); $this->_driver->display(); }
public static function tearDownAfterClass() { Magento_Profiler::disable(); }