From 04f7fab204b6a5b6b0f3d50c492ed698c939fd8a Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Thu, 29 Apr 2010 23:50:07 +0000 Subject: [PATCH] MINOR: update unit test for checking whether a DataObject has been changed or not without providing a field name git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103787 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/DataObjectTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/DataObjectTest.php b/tests/DataObjectTest.php index bd0a4b4cc..8f674967f 100755 --- a/tests/DataObjectTest.php +++ b/tests/DataObjectTest.php @@ -346,6 +346,14 @@ class DataObjectTest extends SapphireTest { $page->Title = null; $this->assertTrue($page->isChanged('Title', 1)); $this->assertTrue($page->isChanged('Title', 2)); + + /* Test when there's not field provided */ + $page = $this->objFromFixture('Page', 'home'); + $page->Title = "New Page Title"; + $this->assertTrue($page->isChanged()); + + $page->write(); + $this->assertFalse($page->isChanged()); } function testRandomSort() {