Skip to content

Commit 5ac09f3

Browse files
Merge branch '8.5' into 9.2
2 parents 7001ce5 + 68efdbb commit 5ac09f3

File tree

2 files changed

+2247
-2239
lines changed

2 files changed

+2247
-2239
lines changed

build/scripts/generate-global-assert-wrappers.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
}
7575

7676
$buffer .= "\n";
77+
$buffer .= "if (!\defined('__PHPUNIT_GLOBAL_ASSERT_WRAPPERS__')) {\n";
7778

7879
foreach ($class->getMethods() as $method) {
7980
if (\strpos($method->getName(), 'assert') !== 0) {
@@ -85,6 +86,7 @@
8586
["*\n * @see Assert::" . $method->getName() . "\n */", ' *'],
8687
$method->getDocComment()
8788
);
89+
8890
$signature = \str_replace('public static ', '', \trim($lines[$method->getStartLine() - 1]));
8991
$body = "{\n Assert::" . $method->getName() . "(...\\func_get_args());\n}";
9092
$buffer .= "$docComment\n$signature\n$body\n\n";
@@ -209,4 +211,6 @@ function onConsecutiveCalls(): ConsecutiveCallsStub
209211
}
210212
';
211213

214+
$buffer .= "\ndefine('__PHPUNIT_GLOBAL_ASSERT_WRAPPERS__', true);\n}";
215+
212216
\file_put_contents(__DIR__ . '/../../src/Framework/Assert/Functions.php', $buffer);

0 commit comments

Comments
 (0)