Index: drupal_reporter.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_reporter.php,v
retrieving revision 1.6
diff -u -r1.6 drupal_reporter.php
--- drupal_reporter.php 21 Jan 2008 07:26:54 -0000 1.6
+++ drupal_reporter.php 25 Jan 2008 04:57:36 -0000
@@ -54,11 +54,11 @@
* @access public
**/
function paintPass($message) {
- parent::paintPass($message);
- $this->test_stack[] = array(
- 'data' => array($this->_htmlEntities($message), 'OK'),
- 'class' => 'simpletest-pass',
- );
+ parent::paintPass($message);
+ $this->test_stack[] = array(
+ 'data' => array($this->_htmlEntities($message), 'OK'),
+ 'class' => 'simpletest-pass',
+ );
//$this->writeContent($this->_htmlEntities($message). ' OK', NULL, 'simpletest-pass');
}
@@ -73,9 +73,9 @@
function paintFail($message) {
parent::paintFail($message);
$this->test_stack[] = array(
- 'data' => array($this->_htmlEntities($message), 'FAIL'),
- 'class' => 'simpletest-fail',
- );
+ 'data' => array($this->_htmlEntities($message), 'FAIL'),
+ 'class' => 'simpletest-fail',
+ );
//$this->writeContent($this->_htmlEntities($message). ' FAIL', NULL, 'simpletest-fail');
}
@@ -135,7 +135,14 @@
$this->_progress++;
$this->paintGroupStart($test_name, 1);
}
-
+
+ function paintMethodStart($test_name) {
+ $this->test_stack[] = array('data' => array("
Start of test: $test_name
", ""), 'class' => 'simpletest-method-begin');
+ }
+
+ function paintMethodEnd($test_name) {
+ $this->test_stack[] = array('data' => array("", ""), 'class' => 'simpletest-method-end');
+ }
/**
* Paints the end of a group test. Will paint the page
@@ -167,12 +174,12 @@
}
$write = array('#collapsible' => $use_grouping, '#collapsed' => $collapsed);
$this->writeToLastField($this->form, $write, $this->form_depth);
- $this->writeContent('' . $this->getPassCount() . ' passes, ' . $this->getFailCount() . ' fails and ' . $this->getExceptionCount() . ' exceptions.', $parent_weight, $class);
- if (count($this->test_stack) != 0) {
+ $this->writeContent('' . $this->getPassCount() . ' passes, ' . $this->getFailCount() . ' fails and ' . $this->getExceptionCount() . ' exceptions.', $parent_weight, $class);
+ if (count($this->test_stack) != 0) {
$this->writeContent(theme('table', array(), $this->test_stack));
$this->test_stack = array();
}
- array_pop($this->form_depth);
+ array_pop($this->form_depth);
}
$this->_progress += array_pop($this->_progress_stack);
@@ -206,22 +213,22 @@
* Recursive function that writes attr to the deepest array
*/
function writeToLastField(&$form, $attr, $keys) {
- while(count($keys) != 0) {
- $value = array_shift($keys);
- if (isset($form[$value])) {
- if (count($keys) == 0) {
- $form[$value] += $attr;
- }
- else {
- $this->writeToLastField($form[$value], $attr, $keys);
- }
- $keys = array();
- }
- else {
- $form[$value] = $attr;
- }
-
- }
+ while(count($keys) != 0) {
+ $value = array_shift($keys);
+ if (isset($form[$value])) {
+ if (count($keys) == 0) {
+ $form[$value] += $attr;
+ }
+ else {
+ $this->writeToLastField($form[$value], $attr, $keys);
+ }
+ $keys = array();
+ }
+ else {
+ $form[$value] = $attr;
+ }
+
+ }
}
/**
@@ -229,31 +236,31 @@
* @param $msg content to write
*/
function writeContent($msg, $weight = NULL, $class = 'simpletest') {
- if (!$weight) {
- $weight = $this->weight++;
- }
- $write['content'.$this->content_count++] = array(
- '#value' => '' . $msg . '
',
- '#weight' => $weight,
- );
- $this->writeToLastField($this->form, $write, $this->form_depth);
+ if (!$weight) {
+ $weight = $this->weight++;
+ }
+ $write['content'.$this->content_count++] = array(
+ '#value' => '' . $msg . '
',
+ '#weight' => $weight,
+ );
+ $this->writeToLastField($this->form, $write, $this->form_depth);
}
/**
* Retrieves weight of the currently deepest fieldset
*/
function getParentWeight($form = NULL, $keys = NULL ) {
- if (!isset($form)) {
- $form = $this->form;
- }
- if (!isset($keys)) {
- $keys = $this->form_depth;
- }
- if(count($keys) != 0) {
- $value = array_shift($keys);
- return $this->getParentWeight($form[$value], $keys);
- }
- return $form['#weight'];
+ if (!isset($form)) {
+ $form = $this->form;
+ }
+ if (!isset($keys)) {
+ $keys = $this->form_depth;
+ }
+ if(count($keys) != 0) {
+ $value = array_shift($keys);
+ return $this->getParentWeight($form[$value], $keys);
+ }
+ return $form['#weight'];
}
}
function unit_tests($args, $reporter) {
Index: simpletest.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/simpletest.css,v
retrieving revision 1.1
diff -u -r1.1 simpletest.css
--- simpletest.css 18 Aug 2006 15:06:58 -0000 1.1
+++ simpletest.css 25 Jan 2008 04:57:14 -0000
@@ -21,4 +21,14 @@
}
tr.simpletest-fail.even {
background: #ffacac;
-}
\ No newline at end of file
+}
+
+tr.simpletest-method-begin.even, tr.simpletest-method-begin.odd {
+ border: none;
+ background: #dddddd;
+}
+
+tr.simpletest-method-end.even, tr.simpletest-method-odd.even {
+ background: #ffffff;
+ border: none;
+}