本文整理匯總了PHP中DebugKitDebugger::getMemoryPoints方法的典型用法代碼示例。如果您正苦於以下問題:PHP DebugKitDebugger::getMemoryPoints方法的具體用法?PHP DebugKitDebugger::getMemoryPoints怎麽用?PHP DebugKitDebugger::getMemoryPoints使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DebugKitDebugger
的用法示例。
在下文中一共展示了DebugKitDebugger::getMemoryPoints方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testMemorySettingAndGetting
/**
* test making memory use markers.
*
* @return void
**/
function testMemorySettingAndGetting()
{
$result = DebugKitDebugger::setMemoryPoint('test marker');
$this->assertTrue($result);
$result = DebugKitDebugger::getMemoryPoints(true);
$this->assertEqual(count($result), 1);
$this->assertTrue(isset($result['test marker']));
$this->assertTrue(is_numeric($result['test marker']));
$result = DebugKitDebugger::getMemoryPoints();
$this->assertTrue(empty($result));
DebugKitDebugger::setMemoryPoint('test marker');
DebugKitDebugger::setMemoryPoint('test marker');
$result = DebugKitDebugger::getMemoryPoints();
$this->assertEqual(count($result), 2);
$this->assertTrue(isset($result['test marker']));
$this->assertTrue(isset($result['test marker #2']));
}
示例2: testBeforeRender
/**
* Test Before Render callback
*
* @return void
**/
public function testBeforeRender() {
$this->_loadController(array(
'panels' => array('test', 'session'),
));
$MockPanel = $this->getMock('DebugPanel');
$MockPanel->expects($this->once())->method('beforeRender');
$this->Controller->Toolbar->panels['test'] = $MockPanel;
$this->Controller->Toolbar->beforeRender($this->Controller);
$this->assertTrue(isset($this->Controller->viewVars['debugToolbarPanels']));
$vars = $this->Controller->viewVars['debugToolbarPanels'];
$expected = array(
'plugin' => 'debug_kit',
'elementName' => 'session_panel',
'content' => $this->Controller->Toolbar->Session->read(),
'disableTimer' => true,
'title' => ''
);
$this->assertEqual($expected, $vars['session']);
$memory = DebugKitDebugger::getMemoryPoints();
$this->assertTrue(isset($memory['Controller render start']));
}
示例3: testBeforeRender
/**
* Test Before Render callback
*
* @return void
**/
function testBeforeRender()
{
$this->Controller->components = array('DebugKit.Toolbar' => array('panels' => array('MockDebug', 'session')));
$this->Controller->Component->init($this->Controller);
$this->Controller->Component->initialize($this->Controller);
$this->Controller->Toolbar->panels['MockDebug']->expectOnce('beforeRender');
$this->Controller->Toolbar->beforeRender($this->Controller);
$this->assertTrue(isset($this->Controller->viewVars['debugToolbarPanels']));
$vars = $this->Controller->viewVars['debugToolbarPanels'];
$expected = array('plugin' => 'debug_kit', 'elementName' => 'session_panel', 'content' => $this->Controller->Toolbar->Session->read(), 'disableTimer' => true, 'title' => '');
$this->assertEqual($expected, $vars['session']);
$memory = DebugKitDebugger::getMemoryPoints();
$this->assertTrue(isset($memory['Controller render start']));
}
示例4: testRenderTimers
/**
* test rendering and ensure that timers are being set.
*
* @access public
* @return void
*/
function testRenderTimers()
{
$this->Controller->viewPath = 'posts';
$this->Controller->action = 'index';
$this->Controller->params = array('action' => 'index', 'controller' => 'posts', 'plugin' => null, 'url' => array('url' => 'posts/index'), 'base' => null, 'here' => '/posts/index');
$this->Controller->layout = 'default';
$View =& new DebugView($this->Controller, false);
$View->render('index');
$result = DebugKitDebugger::getTimers();
$this->assertEqual(count($result), 4);
$this->assertTrue(isset($result['viewRender']));
$this->assertTrue(isset($result['render_default.ctp']));
$this->assertTrue(isset($result['render_index.ctp']));
$result = DebugKitDebugger::getMemoryPoints();
$this->assertTrue(isset($result['View render complete']));
}
示例5: testRenderTimers
/**
* test rendering and ensure that timers are being set.
*
* @return void
*/
public function testRenderTimers()
{
$request = new CakeRequest('/posts/index');
$request->addParams(Router::parse($request->url));
$request->addPaths(array('webroot' => '/', 'base' => '/', 'here' => '/posts/index'));
$this->Controller->setRequest($request);
$this->Controller->viewPath = 'posts';
$this->Controller->layout = 'default';
$View = new DebugView($this->Controller, false);
$View->render('index');
$result = DebugKitDebugger::getTimers();
$this->assertEqual(count($result), 4);
$this->assertTrue(isset($result['viewRender']));
$this->assertTrue(isset($result['render_default.ctp']));
$this->assertTrue(isset($result['render_index.ctp']));
$result = DebugKitDebugger::getMemoryPoints();
$this->assertTrue(isset($result['View render complete']));
}