We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36cb9a6 commit a4abfc1Copy full SHA for a4abfc1
tests/Rules/PHPUnit/data/assert-same-boolean-expected.php
@@ -75,6 +75,26 @@ public function testNonLowercase(): void
75
\PHPUnit\Framework\Assert::assertSame(False, 'foo');
76
}
77
78
+ public function testMaybeTrueFalse(): void
79
+ {
80
+ $a = rand(0, 1) ? true : 'foo';
81
+ \PHPUnit\Framework\Assert::assertSame($a, 'foo');
82
+ $a = rand(0, 1) ? false : 'foo';
83
84
+ }
85
+
86
+ public function testConstMaybeTrueFalse(): void
87
88
+ if (
89
+ !defined('MY_TEST_CONST')
90
+ ) {
91
+ return;
92
93
+ if (MY_TEST_CONST !== true && MY_TEST_CONST !== false) {
94
95
96
+ \PHPUnit\Framework\Assert::assertSame(MY_TEST_CONST, 'foo');
97
98
99
100
const PHPSTAN_PHPUNIT_TRUE = true;
0 commit comments