diff --git a/tests/Laravel/Metadata/VisibleHiddenAttributesTest.php b/tests/Laravel/Metadata/VisibleHiddenAttributesTest.php index 25911553c6..ca55e1fd29 100644 --- a/tests/Laravel/Metadata/VisibleHiddenAttributesTest.php +++ b/tests/Laravel/Metadata/VisibleHiddenAttributesTest.php @@ -106,7 +106,7 @@ public function roles(): HasMany // Mock the ReflectionMethod to return `false` for getFileName to avoid file reading. $reflectionMock = \Mockery::mock(\ReflectionMethod::class)->makePartial(); - $reflectionMock->allows('getFileName')->andReturn(false); + $reflectionMock->shouldReceive('getFileName')->andReturn(false); $relations = $this->modelMetadata->getRelations($model); @@ -119,6 +119,7 @@ private function invokePrivateMethod($object, $methodName, array $parameters = [ $reflection = new \ReflectionClass($object::class); $method = $reflection->getMethod($methodName); $method->setAccessible(true); + return $method->invokeArgs($object, $parameters); } }