Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Test MenuTitle null'ing (see #7505)

  • Loading branch information...
commit 813ed758695c32024e3736efd10fa6933dd36b56 1 parent c394605
@chillu chillu authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 tests/model/SiteTreeTest.php
View
19 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'));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.