public static function setUpBeforeClass() { self::$_testResourceName = 'testtest_' . mt_rand(1000, 9999) . '_setup'; \Magento\Framework\Profiler::enable(); }
protected function setUp() { \Magento\Framework\Profiler::enable(); }
/** * Test display method */ public function testDisplayAndRegisterOutput() { $outputOne = $this->getMock('Magento\\Framework\\Profiler\\Driver\\Standard\\OutputInterface'); $outputOne->expects($this->once())->method('display')->with($this->_stat); $outputTwo = $this->getMock('Magento\\Framework\\Profiler\\Driver\\Standard\\OutputInterface'); $outputTwo->expects($this->once())->method('display')->with($this->_stat); $this->_driver->registerOutput($outputOne); $this->_driver->registerOutput($outputTwo); \Magento\Framework\Profiler::enable(); $this->_driver->display(); \Magento\Framework\Profiler::disable(); $this->_driver->display(); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Timer name must not contain a nesting separator. */ public function testClearException() { \Magento\Framework\Profiler::enable(); \Magento\Framework\Profiler::clear('timer ' . \Magento\Framework\Profiler::NESTING_SEPARATOR . ' name'); }