예제 #1
0
 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();
 }
예제 #2
0
 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');
 }
예제 #3
0
 /**
  * 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();
 }
예제 #4
0
 public static function tearDownAfterClass()
 {
     Magento_Profiler::disable();
 }