Skip to content
This repository
Browse code

MINOR Test MenuTitle null'ing (see #7505)

  • Loading branch information...
commit 813ed758695c32024e3736efd10fa6933dd36b56 1 parent c394605
Ingo Schommer authored June 20, 2012

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  tests/model/SiteTreeTest.php
19  tests/model/SiteTreeTest.php
@@ -891,6 +891,25 @@ function testModifyStatusFlagByInheritance(){
891 891
 		$this->assertContains('InheritedTitle', $treeTitle);
892 892
 		$this->assertContains('inherited-class', $treeTitle);
893 893
 	}
  894
+
  895
+	function testMenuTitleIsUnsetWhenEqualsTitle() {
  896
+		$page = new SiteTree();
  897
+		$page->Title = 'orig';
  898
+		$page->MenuTitle = 'orig';
  899
+		$page->write();
  900
+		
  901
+		// change menu title
  902
+		$page->MenuTitle = 'changed';
  903
+		$page->write();
  904
+		$page = SiteTree::get()->byID($page->ID);
  905
+		$this->assertEquals('changed', $page->getField('MenuTitle'));
  906
+
  907
+		// change menu title back
  908
+		$page->MenuTitle = 'orig';
  909
+		$page->write();
  910
+		$page = SiteTree::get()->byID($page->ID);
  911
+		$this->assertEquals(null, $page->getField('MenuTitle'));
  912
+	}
894 913
 	
895 914
 }
896 915
 

0 notes on commit 813ed75

Please sign in to comment.
Something went wrong with that request. Please try again.