Commit 838d1715 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

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



Change-Id: I6ce075fc4a0d12863fd53d4f30eafcd01fff9ff7
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 1bfb006e
......@@ -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