-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Swiss providers with links to official laws.
- Loading branch information
Showing
23 changed files
with
853 additions
and
24 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
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
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
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
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,79 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2020 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <[email protected]> | ||
*/ | ||
|
||
namespace Yasumi\tests\Switzerland\Fribourg; | ||
|
||
use DateTime; | ||
use Exception; | ||
use ReflectionException; | ||
use Yasumi\Holiday; | ||
use Yasumi\tests\YasumiTestCaseInterface; | ||
|
||
/** | ||
* Class for testing All Saints' Day in Fribourg (Switzerland). | ||
*/ | ||
class AllSaintsDayTest extends FribourgBaseTestCase implements YasumiTestCaseInterface | ||
{ | ||
/** | ||
* The name of the holiday | ||
*/ | ||
public const HOLIDAY = 'allSaintsDay'; | ||
|
||
/** | ||
* Tests All Saints' Day. | ||
* | ||
* @dataProvider AllSaintsDayDataProvider | ||
* | ||
* @param int $year the year for which All Saints' Day needs to be tested | ||
* @param DateTime $expected the expected date | ||
* | ||
* @throws ReflectionException | ||
*/ | ||
public function testAllSaintsDay($year, $expected): void | ||
{ | ||
$this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); | ||
} | ||
|
||
/** | ||
* Tests translated name of All Saints' Day. | ||
* @throws ReflectionException | ||
*/ | ||
public function testTranslation(): void | ||
{ | ||
$this->assertTranslatedHolidayName( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(), | ||
[self::LOCALE => 'Toussaint'] | ||
); | ||
} | ||
|
||
/** | ||
* Tests type of the holiday defined in this test. | ||
* @throws ReflectionException | ||
*/ | ||
public function testHolidayType(): void | ||
{ | ||
$this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER); | ||
} | ||
|
||
/** | ||
* Returns a list of random test dates used for assertion of All Saints' Day. | ||
* | ||
* @return array list of test dates for All Saints' Day | ||
* @throws Exception | ||
*/ | ||
public function AllSaintsDayDataProvider(): array | ||
{ | ||
return $this->generateRandomDates(11, 1, self::TIMEZONE); | ||
} | ||
} |
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,79 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* This file is part of the Yasumi package. | ||
* | ||
* Copyright (c) 2015 - 2020 AzuyaLabs | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Sacha Telgenhof <[email protected]> | ||
*/ | ||
|
||
namespace Yasumi\tests\Switzerland\Fribourg; | ||
|
||
use DateTime; | ||
use Exception; | ||
use ReflectionException; | ||
use Yasumi\Holiday; | ||
use Yasumi\tests\YasumiTestCaseInterface; | ||
|
||
/** | ||
* Class for testing the day of the Assumption of Mary in Fribourg (Switzerland). | ||
*/ | ||
class AssumptionOfMaryTest extends FribourgBaseTestCase implements YasumiTestCaseInterface | ||
{ | ||
/** | ||
* The name of the holiday | ||
*/ | ||
public const HOLIDAY = 'assumptionOfMary'; | ||
|
||
/** | ||
* Tests the day of the Assumption of Mary. | ||
* | ||
* @dataProvider AssumptionOfMaryDataProvider | ||
* | ||
* @param int $year the year for which the day of the Assumption of Mary needs to be tested | ||
* @param DateTime $expected the expected date | ||
* | ||
* @throws ReflectionException | ||
*/ | ||
public function testAssumptionOfMary($year, $expected): void | ||
{ | ||
$this->assertHoliday(self::REGION, self::HOLIDAY, $year, $expected); | ||
} | ||
|
||
/** | ||
* Tests translated name of the day of the Assumption of Mary. | ||
* @throws ReflectionException | ||
*/ | ||
public function testTranslation(): void | ||
{ | ||
$this->assertTranslatedHolidayName( | ||
self::REGION, | ||
self::HOLIDAY, | ||
$this->generateRandomYear(), | ||
[self::LOCALE => 'Assomption'] | ||
); | ||
} | ||
|
||
/** | ||
* Tests type of the holiday defined in this test. | ||
* @throws ReflectionException | ||
*/ | ||
public function testHolidayType(): void | ||
{ | ||
$this->assertHolidayType(self::REGION, self::HOLIDAY, $this->generateRandomYear(), Holiday::TYPE_OTHER); | ||
} | ||
|
||
/** | ||
* Returns a list of random test dates used for assertion of the day of the Assumption of Mary. | ||
* | ||
* @return array list of test dates for the day of the Assumption of Mary | ||
* @throws Exception | ||
*/ | ||
public function AssumptionOfMaryDataProvider(): array | ||
{ | ||
return $this->generateRandomDates(8, 15, self::TIMEZONE); | ||
} | ||
} |
Oops, something went wrong.