mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Test MenuTitle null'ing (see #7505)
This commit is contained in:
parent
c394605507
commit
813ed75869
@ -892,6 +892,25 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
$this->assertContains('inherited-class', $treeTitle);
|
$this->assertContains('inherited-class', $treeTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testMenuTitleIsUnsetWhenEqualsTitle() {
|
||||||
|
$page = new SiteTree();
|
||||||
|
$page->Title = 'orig';
|
||||||
|
$page->MenuTitle = 'orig';
|
||||||
|
$page->write();
|
||||||
|
|
||||||
|
// change menu title
|
||||||
|
$page->MenuTitle = 'changed';
|
||||||
|
$page->write();
|
||||||
|
$page = SiteTree::get()->byID($page->ID);
|
||||||
|
$this->assertEquals('changed', $page->getField('MenuTitle'));
|
||||||
|
|
||||||
|
// change menu title back
|
||||||
|
$page->MenuTitle = 'orig';
|
||||||
|
$page->write();
|
||||||
|
$page = SiteTree::get()->byID($page->ID);
|
||||||
|
$this->assertEquals(null, $page->getField('MenuTitle'));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**#@+
|
/**#@+
|
||||||
|
Loading…
Reference in New Issue
Block a user