Skip to content

Commit

Permalink
Adds working prototype for SQL stacktrases @wip #51
Browse files Browse the repository at this point in the history
  • Loading branch information
madalinoprea committed Mar 15, 2016
1 parent f62fb50 commit d0e4485
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion code/Debug/Model/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public function init(Mage_Core_Block_Abstract $block)
public function startRendering(Mage_Core_Block_Abstract $block)
{
if ($this->isRendering) {
throw new Exception("Block {$this->name} is already marked as rendered");
// Recursive block instances with same name is used - we don't update render start time
$this->renderedCount++;

return;
}

// Re-init data from block (some extension might update dynamically block's template)
Expand Down
5 changes: 3 additions & 2 deletions code/Debug/Test/Model/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public function testInitWithoutTemplate()


/**
* @expectedException Exception
* @expectedExceptionMessage is already marked as rendered
*/
public function testStartRenderingTwice()
{
Expand All @@ -75,8 +73,11 @@ public function testStartRenderingTwice()
$this->assertNotNull($model->getRenderedAt());
$this->assertNull($model->getRenderedCompletedAt());
$this->assertEquals(0, $model->getRenderedDuration());
$initialRenderAt = $model->getRenderedAt();

$model->startRendering($block);
$this->assertEquals(2, $model->getRenderedCount());
$this->assertEquals($initialRenderAt, $model->getRenderedAt());
}


Expand Down

0 comments on commit d0e4485

Please sign in to comment.