-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b56f372
commit f1cfe51
Showing
42 changed files
with
1,662 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
tests/Unit/YoshiKan/Application/Command/Member/AddFederation/AddFederationTest.php
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 |
---|---|---|
@@ -1 +1,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use App\YoshiKan\Application\Command\Member\AddFederation\AddFederation; | ||
|
||
it('can add a federation', function () { | ||
// Arrange | ||
$code = 'FED123'; | ||
$name = 'Example Federation'; | ||
$yearlySubscriptionFee = 100; | ||
$publicLabel = 'Public Federation'; | ||
|
||
// Act | ||
$addFederation = AddFederation::hydrateFromJson((object) [ | ||
'code' => $code, | ||
'name' => $name, | ||
'yearlySubscriptionFee' => $yearlySubscriptionFee, | ||
'publicLabel' => $publicLabel, | ||
]); | ||
|
||
// Assert | ||
expect($addFederation->getCode())->toBe($code) | ||
->and($addFederation->getName())->toBe($name) | ||
->and($addFederation->getYearlySubscriptionFee())->toBe($yearlySubscriptionFee) | ||
->and($addFederation->getPublicLabel())->toBe($publicLabel); | ||
}); |
30 changes: 30 additions & 0 deletions
30
tests/Unit/YoshiKan/Application/Command/Member/AddGrade/AddGradeTest.php
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 |
---|---|---|
@@ -1 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use App\YoshiKan\Application\Command\Member\AddGrade\AddGrade; | ||
|
||
it('can add a grade', function () { | ||
// Arrange | ||
$code = 'GRD123'; | ||
$name = 'Example Grade'; | ||
$color = '#FF0000'; | ||
|
||
// Act | ||
$addGrade = AddGrade::hydrateFromJson((object) [ | ||
'code' => $code, | ||
'name' => $name, | ||
'color' => $color, | ||
]); | ||
|
||
// Assert | ||
expect($addGrade->getCode())->toBe($code) | ||
->and($addGrade->getName())->toBe($name) | ||
->and($addGrade->getColor())->toBe($color); | ||
}); |
33 changes: 33 additions & 0 deletions
33
tests/Unit/YoshiKan/Application/Command/Member/AddGroup/AddGroupTest.php
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 |
---|---|---|
@@ -1 +1,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use App\YoshiKan\Application\Command\Member\AddGroup\AddGroup; | ||
|
||
it('can add a group', function () { | ||
// Arrange | ||
$code = 'GRP123'; | ||
$name = 'Example Group'; | ||
$minAge = 10; | ||
$maxAge = 20; | ||
|
||
// Act | ||
$addGroup = AddGroup::hydrateFromJson((object) [ | ||
'code' => $code, | ||
'name' => $name, | ||
'minAge' => $minAge, | ||
'maxAge' => $maxAge, | ||
]); | ||
|
||
// Assert | ||
expect($addGroup->getCode())->toBe($code) | ||
->and($addGroup->getName())->toBe($name) | ||
->and($addGroup->getMinAge())->toBe($minAge) | ||
->and($addGroup->getMaxAge())->toBe($maxAge); | ||
}); |
27 changes: 27 additions & 0 deletions
27
tests/Unit/YoshiKan/Application/Command/Member/AddLocation/AddLocationTest.php
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 |
---|---|---|
@@ -1 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use App\YoshiKan\Application\Command\Member\AddLocation\AddLocation; | ||
|
||
it('can add a location', function () { | ||
// Arrange | ||
$code = 'LOC123'; | ||
$name = 'Example Location'; | ||
|
||
// Act | ||
$addLocation = AddLocation::hydrateFromJson((object) [ | ||
'code' => $code, | ||
'name' => $name, | ||
]); | ||
|
||
// Assert | ||
expect($addLocation->getCode())->toBe($code) | ||
->and($addLocation->getName())->toBe($name); | ||
}); |
33 changes: 33 additions & 0 deletions
33
tests/Unit/YoshiKan/Application/Command/Member/AddPeriod/AddPeriodTest.php
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 |
---|---|---|
@@ -1 +1,34 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use App\YoshiKan\Application\Command\Member\AddPeriod\AddPeriod; | ||
|
||
it('can add a period', function () { | ||
// Arrange | ||
$code = 'PER123'; | ||
$name = 'Example Period'; | ||
$startDate = new DateTimeImmutable('2024-01-01'); | ||
$endDate = new DateTimeImmutable('2024-12-31'); | ||
|
||
// Act | ||
$addPeriod = AddPeriod::hydrateFromJson((object) [ | ||
'code' => $code, | ||
'name' => $name, | ||
'startDate' => $startDate->format(DateTimeInterface::ATOM), | ||
'endDate' => $endDate->format(DateTimeInterface::ATOM), | ||
]); | ||
|
||
// Assert | ||
expect($addPeriod->getCode())->toBe($code) | ||
->and($addPeriod->getName())->toBe($name) | ||
->and($addPeriod->getStartDate()->format(DateTimeInterface::ATOM))->toBe($startDate->format(DateTimeInterface::ATOM)) | ||
->and($addPeriod->getEndDate()->format(DateTimeInterface::ATOM))->toBe($endDate->format(DateTimeInterface::ATOM)); | ||
}); |
36 changes: 36 additions & 0 deletions
36
tests/Unit/YoshiKan/Application/Command/Member/ChangeFederation/ChangeFederationTest.php
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 |
---|---|---|
@@ -1 +1,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Yoshi-Kan software. | ||
* | ||
* (c) Koen Caerels | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use App\YoshiKan\Application\Command\Member\ChangeFederation\ChangeFederation; | ||
|
||
it('can change a federation', function () { | ||
// Arrange | ||
$id = 1; | ||
$code = 'FED123'; | ||
$name = 'Example Federation'; | ||
$yearlySubscriptionFee = 100; | ||
$publicLabel = 'Public Federation'; | ||
|
||
// Act | ||
$changeFederation = ChangeFederation::hydrateFromJson((object) [ | ||
'id' => $id, | ||
'code' => $code, | ||
'name' => $name, | ||
'yearlySubscriptionFee' => $yearlySubscriptionFee, | ||
'publicLabel' => $publicLabel, | ||
]); | ||
|
||
// Assert | ||
expect($changeFederation->getId())->toBe($id) | ||
->and($changeFederation->getCode())->toBe($code) | ||
->and($changeFederation->getName())->toBe($name) | ||
->and($changeFederation->getYearlySubscriptionFee())->toBe($yearlySubscriptionFee) | ||
->and($changeFederation->getPublicLabel())->toBe($publicLabel); | ||
}); |
Oops, something went wrong.