shorthand for mocking a class with a private constructor
authorChuck Hagenbuch <chuck@horde.org>
Mon, 21 Sep 2009 03:42:51 +0000 (23:42 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 21 Sep 2009 03:42:51 +0000 (23:42 -0400)
framework/Test/lib/Horde/Test/Case.php

index 47f40f8..84b1d9e 100644 (file)
@@ -1,4 +1,11 @@
 <?php
 class Horde_Test_Case extends PHPUnit_Framework_TestCase
 {
+    /**
+     * Useful shorthand if you are mocking a class with a private constructor
+     */
+    public function getMockSkipConstructor($className, array $methods = array(), array $arguments = array(), $mockClassName = '')
+    {
+        return $this->getMock($className, $methods, $arguments, $mockClassName, /* $callOriginalConstructor */ false);
+    }
 }