Skip to content

Commit

Permalink
test: more unalterable tests (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi authored Sep 30, 2024
1 parent f2f7f14 commit cad8002
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
service definition.
* chore: rename term from 'value object' to 'unalterable' to reduce ambiguity
* build: makefile & workflow schedule
* fix: if array is list, don't match the targets using their keys
* test: more unalterable tests

## 1.8.0

Expand Down
28 changes: 28 additions & 0 deletions tests/src/IntegrationTest/UnalterableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace Rekalogika\Mapper\Tests\IntegrationTest;

use Brick\Money\Money;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ReadableCollection;
use Rekalogika\Mapper\Tests\Common\FrameworkTestCase;
use Rekalogika\Mapper\Tests\Fixtures\Unalterable\PublicGetter;
use Rekalogika\Mapper\Tests\Fixtures\Unalterable\PublicPropertyPublicGetter;
Expand Down Expand Up @@ -67,6 +70,31 @@ public static function provideUnalterable(): iterable
ReadonlyPublicProperty::class,
true,
];

yield self::desc(Money::class) => [
Money::class,
true,
];

yield self::desc(\DateTime::class) => [
\DateTime::class,
true,
];

yield self::desc(\DateTimeImmutable::class) => [
\DateTimeImmutable::class,
true,
];

yield self::desc(Collection::class) => [
Collection::class,
false,
];

yield self::desc(ReadableCollection::class) => [
ReadableCollection::class,
false,
];
}

/**
Expand Down

0 comments on commit cad8002

Please sign in to comment.