Commit 33c71cb6 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3253749: Incorrect isEmpty() check for some empty Exception days - add test

parent 628c8d72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,8 +151,8 @@ class OfficeHoursDatetime extends Datetime {
      return TRUE;
    }
    if ($element == -1) {
      // Value may be integer or text, depending on source.
      // Empty hours/minutes, but comment enabled.
      // Value may be integer or text, depending on source.
      return TRUE;
    }
    if (is_array($element)) {
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ class OfficeHoursDatetimeUnitTest extends UnitTestCase {
  public function testDateTimeIsEmpty() {

    $this::assertTrue(OfficeHoursDatetime::isEmpty(NULL), 'Test Datetime NULL is empty.');
    $this::assertNotTrue(OfficeHoursDatetime::isEmpty(-1), 'Test 24:00 is not empty.');
    $this::assertTrue(OfficeHoursDatetime::isEmpty(-1), 'Test 24:00 is not empty.');
    $this::assertTrue(OfficeHoursDatetime::isEmpty('-1'), 'Test 24:00 is not empty.');
    $this::assertTrue(OfficeHoursDatetime::isEmpty(''), 'Test empty slot is empty.');
    $this::assertTrue(OfficeHoursDatetime::isEmpty([
      'time' => '',