From 9c6552e5745c4d1a260c80fe7d4a8b6509a4f570 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 6 Aug 2011 15:22:54 -0400 Subject: [PATCH] Set null_allowed to TRUE by default. --- base/weak_interface.php | 2 +- testing/tests/base/weak_interface_test.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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"; - } } -- 2.43.5