From 15602cfb319b0f359dcf95dc1ef71d982ea033f9 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 29 Jan 2019 13:33:12 +0200 Subject: [PATCH] Fix for case insensitive string comparison assertion in checkbox group field test In SilverStripe 4.4 field labels are sentence cased. This changes the assertion to be flexible and pass in 4.4+ as well as <=4.3 --- tests/Forms/TextCheckboxGroupFieldTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Forms/TextCheckboxGroupFieldTest.php b/tests/Forms/TextCheckboxGroupFieldTest.php index 3f46dcb7..a6171e39 100644 --- a/tests/Forms/TextCheckboxGroupFieldTest.php +++ b/tests/Forms/TextCheckboxGroupFieldTest.php @@ -27,7 +27,8 @@ protected function setUp() public function testFieldIsAssignedFirstFieldsTitleInConstructor() { - $this->assertSame('Hello World', $this->field->Title()); + // Note: SilverStripe 4.0-4.3 = "Hello World", 4.4+ "Hello world" + $this->assertTrue(strcasecmp('Hello World', $this->field->Title()) === 0); } public function testFieldReturnsCompositeFieldTemplateOnReadonlyTransformation()