From: Robert Sesek Date: Sat, 6 Aug 2011 19:22:54 +0000 (-0400) Subject: Set null_allowed to TRUE by default. X-Git-Tag: api-2~59 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=9c6552e5745c4d1a260c80fe7d4a8b6509a4f570;p=hoplite.git Set null_allowed to TRUE by default. --- diff --git a/base/weak_interface.php b/base/weak_interface.php index 5f73f9d..d292715 100644 --- a/base/weak_interface.php +++ b/base/weak_interface.php @@ -38,7 +38,7 @@ class WeakInterface private $object_reflector = NULL; /*! @var bool Whether or not a NULL object will throw when called. */ - private $null_allowed = FALSE; + private $null_allowed = TRUE; /*! Creates a weak interface with the name of an actual interface. */ public function __construct($interface) diff --git a/testing/tests/base/weak_interface_test.php b/testing/tests/base/weak_interface_test.php index e547ff7..c348252 100644 --- a/testing/tests/base/weak_interface_test.php +++ b/testing/tests/base/weak_interface_test.php @@ -88,15 +88,15 @@ class WeakInterfaceTest extends \PHPUnit_Framework_TestCase public function testNull() { - $this->setExpectedException('hoplite\base\WeakInterfaceException'); $delegate = new base\WeakInterface('hoplite\test\AllOptional'); $delegate->DoSomething(); } public function testNullAllowed() { + $this->setExpectedException('hoplite\base\WeakInterfaceException'); $delegate = new base\WeakInterface('hoplite\test\AllOptional'); - $delegate->set_null_allowed(TRUE); + $delegate->set_null_allowed(FALSE); $delegate->DoSomething(); } @@ -122,6 +122,5 @@ class WeakInterfaceTest extends \PHPUnit_Framework_TestCase $imp->DoSomething(); $mt_e = microtime(TRUE); print 'Straight Call: ' . ($mt_e - $mt_s) . 'µs' . "\n"; - } }