Skip to content

Commit 03c9818

Browse files
committed
Add regression test
1 parent 0e496ac commit 03c9818

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public function testExtension(): void
4747
]);
4848
}
4949

50+
public function testBug68(): void
51+
{
52+
$this->analyse([__DIR__ . '/data/bug-68.php'], []);
53+
}
54+
5055
public function testBug85(): void
5156
{
5257
$this->analyse([__DIR__ . '/data/bug-85.php'], []);
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PHPStan\Type\WebMozartAssert;
6+
7+
use Webmozart\Assert\Assert;
8+
9+
final class Bug68
10+
{
11+
12+
public function foo(): void
13+
{
14+
$encryptedValue = "some value";
15+
$valueParts = explode(':', $encryptedValue);
16+
17+
Assert::count(
18+
$valueParts,
19+
2,
20+
'Encrypted secret parameter was expected to consist of 2 parts separated by a colon'
21+
);
22+
}
23+
24+
}

0 commit comments

Comments
 (0)