Skip to content

Commit a3fea59

Browse files
committed
Lower msi a bit, add some exception code checks
1 parent 30c6b31 commit a3fea59

9 files changed

Lines changed: 16 additions & 1 deletion

infection.json.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"@default": true
1616
},
1717
"minMsi": 84,
18-
"minCoveredMsi": 92,
18+
"minCoveredMsi": 88,
1919
"testFrameworkOptions": "--testsuite=unit"
2020
}

tests/Unit/MetadataHydratorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public function testHydrate(): void
173173
public function testHydrateUnknownClass(): void
174174
{
175175
$this->expectException(ClassNotSupported::class);
176+
$this->expectExceptionCode(0);
176177

177178
$this->hydrator->hydrate(
178179
'Unknown',

tests/Unit/Normalizer/ArrayNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function testDenormalizeWithNull(): void
3434
public function testNormalizeWithInvalidArgument(): void
3535
{
3636
$this->expectException(InvalidArgument::class);
37+
$this->expectExceptionCode(0);
3738

3839
$innerNormalizer = $this->createMock(Normalizer::class);
3940

@@ -44,6 +45,7 @@ public function testNormalizeWithInvalidArgument(): void
4445
public function testDenormalizeWithInvalidArgument(): void
4546
{
4647
$this->expectException(InvalidArgument::class);
48+
$this->expectExceptionCode(0);
4749

4850
$innerNormalizer = $this->createMock(Normalizer::class);
4951

tests/Unit/Normalizer/ArrayShapeNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function testDenormalizeWithNull(): void
3434
public function testNormalizeWithInvalidArgument(): void
3535
{
3636
$this->expectException(InvalidArgument::class);
37+
$this->expectExceptionCode(0);
3738

3839
$innerNormalizer = $this->createMock(Normalizer::class);
3940

@@ -44,6 +45,7 @@ public function testNormalizeWithInvalidArgument(): void
4445
public function testDenormalizeWithInvalidArgument(): void
4546
{
4647
$this->expectException(InvalidArgument::class);
48+
$this->expectExceptionCode(0);
4749

4850
$innerNormalizer = $this->createMock(Normalizer::class);
4951

tests/Unit/Normalizer/DateTimeImmutableNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function testDenormalizeWithNull(): void
2929
public function testNormalizeWithInvalidArgument(): void
3030
{
3131
$this->expectException(InvalidArgument::class);
32+
$this->expectExceptionCode(0);
3233

3334
$normalizer = new DateTimeImmutableNormalizer();
3435
$normalizer->normalize(123);
@@ -37,6 +38,7 @@ public function testNormalizeWithInvalidArgument(): void
3738
public function testDenormalizeWithInvalidArgument(): void
3839
{
3940
$this->expectException(InvalidArgument::class);
41+
$this->expectExceptionCode(0);
4042

4143
$normalizer = new DateTimeImmutableNormalizer();
4244
$normalizer->denormalize(123);

tests/Unit/Normalizer/DateTimeNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testDenormalizeWithNull(): void
2828
public function testNormalizeWithInvalidArgument(): void
2929
{
3030
$this->expectException(InvalidArgument::class);
31+
$this->expectExceptionCode(0);
3132

3233
$normalizer = new DateTimeNormalizer();
3334
$normalizer->normalize(123);
@@ -36,6 +37,7 @@ public function testNormalizeWithInvalidArgument(): void
3637
public function testDenormalizeWithInvalidArgument(): void
3738
{
3839
$this->expectException(InvalidArgument::class);
40+
$this->expectExceptionCode(0);
3941

4042
$normalizer = new DateTimeNormalizer();
4143
$normalizer->denormalize(123);

tests/Unit/Normalizer/DateTimeZoneNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function testDenormalizeWithNull(): void
2828
public function testNormalizeWithInvalidArgument(): void
2929
{
3030
$this->expectException(InvalidArgument::class);
31+
$this->expectExceptionCode(0);
3132

3233
$normalizer = new DateTimeZoneNormalizer();
3334
$normalizer->normalize(123);
@@ -36,6 +37,7 @@ public function testNormalizeWithInvalidArgument(): void
3637
public function testDenormalizeWithInvalidArgument(): void
3738
{
3839
$this->expectException(InvalidArgument::class);
40+
$this->expectExceptionCode(0);
3941

4042
$normalizer = new DateTimeZoneNormalizer();
4143
$normalizer->denormalize(123);

tests/Unit/Normalizer/EnumNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function testDenormalizeWithNull(): void
3434
public function testNormalizeWithInvalidArgument(): void
3535
{
3636
$this->expectException(InvalidArgument::class);
37+
$this->expectExceptionCode(0);
3738
$this->expectExceptionMessage('type "Patchlevel\Hydrator\Tests\Unit\Fixture\Status|null" was expected but "string" was passed.');
3839

3940
$normalizer = new EnumNormalizer(Status::class);
@@ -43,6 +44,7 @@ public function testNormalizeWithInvalidArgument(): void
4344
public function testDenormalizeWithInvalidArgument(): void
4445
{
4546
$this->expectException(InvalidArgument::class);
47+
$this->expectExceptionCode(0);
4648
$this->expectExceptionMessage('foo');
4749
$this->expectExceptionMessage('Patchlevel\Hydrator\Tests\Unit\Fixture\Status');
4850

tests/Unit/Normalizer/ObjectNormalizerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function testDenormalizeWithNull(): void
6565
public function testNormalizeWithInvalidArgument(): void
6666
{
6767
$this->expectException(InvalidArgument::class);
68+
$this->expectExceptionCode(0);
6869
$this->expectExceptionMessage('type "Patchlevel\Hydrator\Tests\Unit\Fixture\ProfileCreated|null" was expected but "string" was passed.');
6970

7071
$hydrator = $this->createMock(Hydrator::class);
@@ -77,6 +78,7 @@ public function testNormalizeWithInvalidArgument(): void
7778
public function testDenormalizeWithInvalidArgument(): void
7879
{
7980
$this->expectException(InvalidArgument::class);
81+
$this->expectExceptionCode(0);
8082
$this->expectExceptionMessage('array<string, mixed>|null" was expected but "string" was passed.');
8183

8284
$hydrator = $this->createMock(Hydrator::class);

0 commit comments

Comments
 (0)