Skip to content

Commit

Permalink
MINOR Test MenuTitle null'ing (see #7505)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Jun 20, 2012
1 parent c394605 commit 813ed75
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/model/SiteTreeTest.php
Expand Up @@ -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'));
}

}

Expand Down

0 comments on commit 813ed75

Please sign in to comment.