Permalink
Browse files

Added debug method to BasicUnitTestCase

  • Loading branch information...
1 parent bd5c4ef commit 800ad57e8baebafc373a0752b15a414aed04310c @ginatrapani ginatrapani committed Jan 21, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 tests/classes/class.ThinkUpBasicUnitTestCase.php
@@ -54,6 +54,7 @@ public function setUp() {
}
$webapp = Webapp::getInstance();
$crawler = Crawler::getInstance();
+ $this->DEBUG = (getenv('TEST_DEBUG')!==false) ? true : false;
}
/**
@@ -129,4 +130,12 @@ protected function simulateLogin($email, $is_admin = false) {
$_SESSION[$config->getValue('source_root_path')]['user_is_admin'] = true;
}
}
+
+ public function debug($message) {
+ if($this->DEBUG) {
+ $bt = debug_backtrace();
+ print get_class($this) . ": line " . $bt[0]['line'] . " - " . $message . "\n";
+ }
+ }
+
}

0 comments on commit 800ad57

Please sign in to comment.