Skip to content

Commit

Permalink
Fix for case insensitive string comparison assertion in checkbox grou…
Browse files Browse the repository at this point in the history
…p 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
  • Loading branch information
robbieaverill committed Jan 29, 2019
1 parent 7649434 commit 15602cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/Forms/TextCheckboxGroupFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 15602cf

Please sign in to comment.