From c9963998a3e3f15774b34977d9383527536f9ecf Mon Sep 17 00:00:00 2001 From: W0rma Date: Fri, 6 Oct 2023 12:23:40 +0200 Subject: [PATCH] Consider new boolean parameter in Generator::testDouble() added in PHPUnit 10.4 --- src/Stub.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Stub.php b/src/Stub.php index f3c0634..aaee8bc 100644 --- a/src/Stub.php +++ b/src/Stub.php @@ -415,7 +415,12 @@ public static function constructEmptyExcept( private static function generateMock() { - return self::doGenerateMock(func_get_args()); + $args = func_get_args(); + if (version_compare(PHPUnitVersion::series(), '10.4', '>=') && !is_bool($args[1])) { + array_splice($args, 1, 0, [true]); + } + + return self::doGenerateMock($args); } /**