Commit f6a85873 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Add test for removing a column of a view (bug #819396)"

parents deb7d5f3 838d1715
......@@ -113,6 +113,18 @@ class ViewTest extends MaharaUnitTest {
}
}
/**
* Test that removing a column updates numcolumns
*/
public function testRemovecolumn() {
$before = $this->view->get('numcolumns');
$expect = $before > 1 ? $before - 1 : 1;
$this->view->removecolumn(array('column' => 1));
$this->assertEquals($this->view->get('numcolumns'), $expect);
}
/**
* test that when we delete a view,
* it actually gets deleted from the database
......
......@@ -1367,7 +1367,7 @@ class View {
// Set column widths
$layout = $this->get_layout();
$i = 0;
$is_ie6 = (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0'));
$is_ie6 = isset($_SERVER['HTTP_USER_AGENT']) && (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0'));
foreach (explode(',', $layout->widths) as $width) {
// IE6 has interesting padding issues that mean we have to tell
// porkies so all the columns stay beside each other
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment