From 60453176efc7c210d7e337376ffbfd7e84a0ad0c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 12 Apr 2010 00:50:16 +0000 Subject: [PATCH] MINOR Added unit test for ViewableData::MultipleOf() when using an offset of 1 (an alternative approach) (from r95966) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102321 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/DataObjectSetTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/DataObjectSetTest.php b/tests/DataObjectSetTest.php index 0fc24f9f2..bf1481306 100644 --- a/tests/DataObjectSetTest.php +++ b/tests/DataObjectSetTest.php @@ -121,6 +121,22 @@ class DataObjectSetTest extends SapphireTest { $this->assertFalse($commArr[4]->IsMultipleOf3); $this->assertFalse($commArr[5]->IsMultipleOf3); $this->assertTrue($commArr[6]->IsMultipleOf3); + + foreach($comments as $comment) { + if($comment->MultipleOf(3, 1)) { + $comment->IsMultipleOf3 = true; + } else { + $comment->IsMultipleOf3 = false; + } + } + + $this->assertFalse($commArr[0]->IsMultipleOf3); + $this->assertFalse($commArr[1]->IsMultipleOf3); + $this->assertTrue($commArr[2]->IsMultipleOf3); + $this->assertFalse($commArr[3]->IsMultipleOf3); + $this->assertFalse($commArr[4]->IsMultipleOf3); + $this->assertTrue($commArr[5]->IsMultipleOf3); + $this->assertFalse($commArr[6]->IsMultipleOf3); } /**