Permalink
Browse files

MINOR Test MenuTitle null'ing (see #7505)

  • Loading branch information...
1 parent c394605 commit 813ed758695c32024e3736efd10fa6933dd36b56 @chillu chillu committed Jun 20, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 tests/model/SiteTreeTest.php
@@ -891,6 +891,25 @@ function testModifyStatusFlagByInheritance(){
$this->assertContains('InheritedTitle', $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'));
+ }
}

0 comments on commit 813ed75

Please sign in to comment.