Skip to content

Commit

Permalink
Updates unit tests so that we store durations as real misliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
madalinoprea committed Feb 26, 2016
1 parent 4d6113a commit b2fc2e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/Debug/Test/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testUpdateProfiling()
$requestInfo->expects($this->any())->method('getIsStarted')->willReturn(true);
$requestInfo->expects($this->once())->method('initQueries');
$requestInfo->expects($this->once())->method('completeLogging');
$requestInfo->expects($this->once())->method('setRenderingTime')->with(0.20);
$requestInfo->expects($this->once())->method('setRenderingTime')->with(200);
$requestInfo->expects($this->once())->method('setPeakMemory')->with(1230300);
$requestInfo->expects($this->once())->method('setTime')->with(0.1231);
$requestInfo->expects($this->once())->method('setTimers');
Expand Down
10 changes: 5 additions & 5 deletions code/Debug/Test/Model/RequestInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ public function testGetBlocksAsArray()
$this->assertEquals('block 1', $blockInfoArray[0]['name']);
$this->assertEquals('Mage_Core_Block_Template', $blockInfoArray[0]['class']);
$this->assertEquals('some_template.phtml', $blockInfoArray[0]['template']);
$this->assertEquals(null, $blockInfoArray[0]['time (s)']);
$this->assertArrayHasKey('time (s)', $blockInfoArray[1]);
$this->assertEquals(null, $blockInfoArray[0]['time (ms)']);
$this->assertArrayHasKey('time (ms)', $blockInfoArray[1]);
$this->assertEquals(1, $blockInfoArray[1]['count']);
}

Expand Down Expand Up @@ -405,11 +405,11 @@ public function testGetRenderingTime()
Sheep_Debug_Model_Block::$startRenderingTime = 0.75;

$actual = $this->model->getRenderingTime();
$this->assertEquals(0.15, $actual);
$this->assertEquals(150, $actual);

$this->model->setRenderingTime(0.4567);
$this->model->setRenderingTime(4567);
$actual = $this->model->getRenderingTime();
$this->assertEquals(0.4567, $actual);
$this->assertEquals(4567, $actual);
}


Expand Down

0 comments on commit b2fc2e8

Please sign in to comment.