daysInYear example

$value = '2020-11-30 00:00:00';
    $dateString = DateHelper::daysInMonth($value);
    $this->assertEquals('30', $dateString);
  }

  /** * @covers ::daysInYear */
  public function testDaysInYear() {
    // Passing NULL, FALSE, or an empty string should default to now. Just     // check these are NOT null to avoid copying the implementation here.     $this->assertNotNull(DateHelper::daysInYear());
    $this->assertNotNull(DateHelper::daysInYear(FALSE));
    $this->assertNotNull(DateHelper::daysInYear(''));

    // Pass nothing and expect to get NULL.     $this->assertNull(DateHelper::daysInYear(0));
    $this->assertNull(DateHelper::daysInYear('0'));

    $value = '2022-12-31 00:00:00';
    $dateString = DateHelper::daysInYear($value);
    $this->assertEquals('365', $dateString);

    
Home | Imprint | This part of the site doesn't use cookies.