Skip to content

Commit

Permalink
Added timing debugging to TestOfInstallerController
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed Dec 6, 2011
1 parent 22f66b8 commit 50a5c9d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/TestOfInstallerController.php
Expand Up @@ -31,8 +31,22 @@
require_once THINKUP_ROOT_PATH.'webapp/config.inc.php';

class TestOfInstallerController extends ThinkUpUnitTestCase {

/**
* Start time
* @var int
*/
var $start;
/**
*
* @var int
*/
var $current_test_index = 0;
public function setUp() {
if (getenv("TEST_TIMING")=="1") {
list($usec, $sec) = explode(" ", microtime());
$this->start = ((float)$usec + (float)$sec);
}
$this->current_test_index++;
parent::setUp();
if ( !defined('THINKUP_ROOT_PATH') ) {
define('THINKUP_ROOT_PATH', str_replace("\\",'/', dirname(dirname(__FILE__))) .'/');
Expand All @@ -47,6 +61,13 @@ public function setUp() {

public function tearDown() {
parent::tearDown();
if (getenv("TEST_TIMING")=="1") {
list($usec, $sec) = explode(" ", microtime());
$finish = ((float)$usec + (float)$sec);
$runtime = round($finish - $this->start);
$test_names = self::getTests();
printf($test_names[$this->current_test_index] . " took ". $runtime ." seconds\n");
}
}

public function testAlreadyInstalledNoAdmin() {
Expand Down Expand Up @@ -111,6 +132,7 @@ public function testFreshInstallStep1AllReqsMet() {
$controller = new InstallerController(true);
$this->assertTrue(isset($controller));
$result = $controller->go();
$this->debug($result);
$this->assertPattern('/Your system has everything it needs to run ThinkUp./', $result);
//make sure we've auto-progressed to step 2 b/c all requirements have been met
$this->assertPattern('/Create Your ThinkUp Account/', $result);
Expand Down

0 comments on commit 50a5c9d

Please sign in to comment.