Set null_allowed to TRUE by default.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 6 Aug 2011 19:22:54 +0000 (15:22 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 6 Aug 2011 19:23:40 +0000 (15:23 -0400)
base/weak_interface.php
testing/tests/base/weak_interface_test.php

index 5f73f9da8f2fb5c684b2ec1a0817a067346b6276..d292715255ffb776d767171fe5e9e32929850ae3 100644 (file)
@@ -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)
index e547ff71d662c40ca89438aea3defd9f3f137ced..c3482527a211a220d1289e79f39e084fe6209407 100644 (file)
@@ -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";
-    
   }
 }