-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from jul6art/master
Added Belgian holidays
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Checkdomain\Holiday\Provider; | ||
|
||
/** | ||
* Belgian holiday provider | ||
* | ||
* @author Jul6art <[email protected]> | ||
* @since 2020-11-09 | ||
*/ | ||
class BE extends AbstractEaster | ||
{ | ||
/** | ||
* @param int $year | ||
* | ||
* @return mixed | ||
*/ | ||
public function getHolidaysByYear($year) | ||
{ | ||
$easter = $this->getEasterDates($year); | ||
|
||
return [ | ||
'01-01' => $this->createData('Jour de l\'an'), | ||
'05-01' => $this->createData('Fête du Travail'), | ||
'07-21' => $this->createData('Fête Nationale'), | ||
'08-15' => $this->createData('Assomption'), | ||
'11-01' => $this->createData('Toussaint'), | ||
'11-11' => $this->createData('Armistice'), | ||
'12-25' => $this->createData('Noël'), | ||
$easter['easterMonday']->format(self::DATE_FORMAT) => $this->createData('Lundi de Pâques'), | ||
$easter['ascensionDay']->format(self::DATE_FORMAT) => $this->createData('Jeudi de l\'Ascension'), | ||
$easter['pentecostMonday']->format(self::DATE_FORMAT) => $this->createData('Lundi de Pentecôte'), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Checkdomain\Holiday\Provider; | ||
|
||
/** | ||
* Class BETest | ||
*/ | ||
class BETest extends AbstractTest | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function setUp() | ||
{ | ||
$this->provider = new BE(); | ||
} | ||
|
||
/** | ||
* Provides some test dates and the expectation | ||
* | ||
* @return array | ||
*/ | ||
public function dateProvider() | ||
{ | ||
return array( | ||
array('2017-03-21', null, null), | ||
array('2017-01-01', null, array('name' => 'Jour de l\'an')), | ||
array('2017-04-17', null, array('name' => 'Lundi de Pâques')), | ||
array('2017-05-01', null, array('name' => 'Fête du Travail')), | ||
array('2017-05-09', null, null), | ||
array('2017-05-25', null, array('name' => 'Jeudi de l\'Ascension')), | ||
array('2017-06-05', null, array('name' => 'Lundi de Pentecôte')), | ||
array('2017-07-21', null, array('name' => 'Fête Nationale')), | ||
array('2017-08-15', null, array('name' => 'Assomption')), | ||
array('2017-11-01', null, array('name' => 'Toussaint')), | ||
array('2017-11-11', null, array('name' => 'Armistice')), | ||
array('2017-12-25', null, array('name' => 'Noël')), | ||
); | ||
} | ||
} |