Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Merge pull request #436 from Hackwar/jgrid
Browse files Browse the repository at this point in the history
Extending Unittests for JGrid to reach 100% coverage.
  • Loading branch information
eddieajau committed Oct 18, 2011
2 parents 76b52b4 + 198b70e commit 22adfb6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/suite/joomla/html/JGridTest.php
Expand Up @@ -510,10 +510,28 @@ public function testToString()
$assertion->options = array('class' => '1');
$assertion->content = 'testcontent1';
$table->rows = array(array('_row' => array('class' => 'test1'), 'testCol1' => $assertion));

//Make sure the body is rendered correctly
$this->assertThat(
$table->toString(),
$this->equalTo("<table><tbody>\n\t<tr class=\"test1\">\n\t\t<td class=\"1\">testcontent1</td>\n\t</tr>\n</tbody></table>")
);

//Make sure the header is rendered correctly
$table->specialRows = array('header' => array(0), 'footer' => array());

$this->assertThat(
$table->toString(),
$this->equalTo("<table><thead>\n\t<tr class=\"test1\">\n\t\t<th class=\"1\">testcontent1</th>\n\t</tr>\n</thead></table>")
);

//Make sure the footer is rendered correctly
$table->specialRows = array('header' => array(), 'footer' => array(0));

$this->assertThat(
$table->toString(),
$this->equalTo("<table><tfoot>\n\t<tr class=\"test1\">\n\t\t<td class=\"1\">testcontent1</td>\n\t</tr>\n</tfoot></table>")
);
}

/**
Expand Down

0 comments on commit 22adfb6

Please sign in to comment.