From 6f895f9c673d5b978a489eeaab3b8e67047f826d Mon Sep 17 00:00:00 2001 From: mcn-fredw Date: Fri, 11 Jan 2019 15:28:12 -0700 Subject: [PATCH] allow double resolve on objects for partial mocks. --- src/MockFromArrayCreatorTrait.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MockFromArrayCreatorTrait.php b/src/MockFromArrayCreatorTrait.php index 7081fa9..edd49c1 100644 --- a/src/MockFromArrayCreatorTrait.php +++ b/src/MockFromArrayCreatorTrait.php @@ -216,6 +216,10 @@ protected function resolveMockBuilderArgument($arg, array &$domain = []) { if (! is_array($arg)) { /* check for domain reference */ + if (is_object($arg)) { + /* arg can't be a domain reference */ + return $arg; + } if (2 > strlen($arg)) { /* arg can't be a domain reference */ return $arg;