File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
tests/Type/WebMozartAssert Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,24 @@ public function testExtension(): void
4747 ]);
4848 }
4949
50+ public function testBug8 (): void
51+ {
52+ $ this ->analyse ([__DIR__ . '/data/bug-8.php ' ], [
53+ [
54+ 'Call to static method Webmozart\Assert\Assert::numeric() with numeric-string will always evaluate to true. ' ,
55+ 15 ,
56+ ],
57+ [
58+ 'Call to static method Webmozart\Assert\Assert::numeric() with \'foo \' will always evaluate to false. ' ,
59+ 16 ,
60+ ],
61+ [
62+ 'Call to static method Webmozart\Assert\Assert::numeric() with \'17.19 \' will always evaluate to true. ' ,
63+ 17 ,
64+ ],
65+ ]);
66+ }
67+
5068 public function testBug33 (): void
5169 {
5270 $ this ->analyse ([__DIR__ . '/data/bug-33.php ' ], []);
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace WebmozartAssertBug8 ;
6+
7+ use Webmozart \Assert \Assert ;
8+
9+ class Bug8
10+ {
11+
12+ public function foo (string $ a ): void
13+ {
14+ Assert::numeric ($ a );
15+ Assert::numeric ($ a );
16+ Assert::numeric ('foo ' );
17+ Assert::numeric ('17.19 ' );
18+ }
19+
20+ }
You can’t perform that action at this time.
0 commit comments