JayBizzle / PHP-Seasons

A small utility class that returns the meteorological season from a given date
MIT License
6 stars 2 forks source link

Wrong season retrieved ... #14

Open sensorario opened 7 years ago

sensorario commented 7 years ago

Season is wrongly retrieved: updating dataProvider of ::testDateParsing I found this Bug. Please consider to fix it or, ... just wait my next PR. ^_^

/**
 * @dataProvider dateStrings
 */
public function testDateParsing($original, $expected)
{
    $result = $this->season->get($original);
    $this->assertEquals($expected, $result);
}

public function dateStrings()
{
    return array(
        array('20st March', Seasons::SEASON_SUMMER),
        array('20st June', Seasons::SEASON_AUTUMN),
        array('22st September', Seasons::SEASON_WINTER),
        array('20st December', Seasons::SEASON_SPRING),

        array('1st June', Seasons::SEASON_SUMMER),
        array('1st October 2016', Seasons::SEASON_AUTUMN),
        array('31st December', Seasons::SEASON_WINTER),
    );
}
strarsis commented 5 years ago

@sensorario: Have you made a PR for this? Has it been merged since then? JayBizzle: Has this been fixed since then?