[limb-svn] r7101 - in 3.x/trunk/limb/core: src tests/cases

svn at limb-project.com svn at limb-project.com
Wed Jul 9 01:18:15 MSD 2008


Author: pachanga
Date: 2008-07-09 01:18:15 +0400 (Wed, 09 Jul 2008)
New Revision: 7101
URL: http://fisheye.limb-project.com/changelog/limb/?cs=7101

Modified:
   3.x/trunk/limb/core/src/lmbObject.class.php
   3.x/trunk/limb/core/src/lmbProxy.class.php
   3.x/trunk/limb/core/tests/cases/lmbObjectTest.class.php
   3.x/trunk/limb/core/tests/cases/lmbProxyTest.class.php
Log:
-- removing obsolete getHash() stuff from lmbObject

Modified: 3.x/trunk/limb/core/src/lmbObject.class.php
===================================================================
--- 3.x/trunk/limb/core/src/lmbObject.class.php	2008-07-08 21:12:39 UTC (rev 7100)
+++ 3.x/trunk/limb/core/src/lmbObject.class.php	2008-07-08 21:18:15 UTC (rev 7101)
@@ -89,16 +89,8 @@
   {
     return get_class($this);
   }
+
   /**
-   * Returns object's hash in md5 form
-   * @see md5
-   * @return string
-   */
-  function getHash()
-  {
-    return md5(serialize($this));
-  }
-  /**
    * Merges existing properties with new ones
    * @param array
    */

Modified: 3.x/trunk/limb/core/src/lmbProxy.class.php
===================================================================
--- 3.x/trunk/limb/core/src/lmbProxy.class.php	2008-07-08 21:12:39 UTC (rev 7100)
+++ 3.x/trunk/limb/core/src/lmbProxy.class.php	2008-07-08 21:18:15 UTC (rev 7101)
@@ -27,18 +27,6 @@
   protected $original;
 
   /**
-  * Returns hash string for original object
-  * @return string
-  */
-  function getHash()
-  {
-    if(!$this->is_resolved)
-      return md5(serialize($this));
-
-    return $this->resolve()->getHash();
-  }
-
-  /**
   * Creates original object
   */
   abstract protected function _createOriginalObject();

Modified: 3.x/trunk/limb/core/tests/cases/lmbObjectTest.class.php
===================================================================
--- 3.x/trunk/limb/core/tests/cases/lmbObjectTest.class.php	2008-07-08 21:12:39 UTC (rev 7100)
+++ 3.x/trunk/limb/core/tests/cases/lmbObjectTest.class.php	2008-07-08 21:18:15 UTC (rev 7101)
@@ -325,15 +325,6 @@
     $this->assertEqual($object->_guarded, 'yeah');
   }
 
-  function testGetHash()
-  {
-    $o1 = new lmbObject();
-    $o2 = new lmbObject();
-
-    $this->assertNotNull($o1->getHash());
-    $this->assertEqual($o1->getHash(), $o2->getHash());
-  }
-
   function testGetClass()
   {
     $o1 = new lmbObject();

Modified: 3.x/trunk/limb/core/tests/cases/lmbProxyTest.class.php
===================================================================
--- 3.x/trunk/limb/core/tests/cases/lmbProxyTest.class.php	2008-07-08 21:12:39 UTC (rev 7100)
+++ 3.x/trunk/limb/core/tests/cases/lmbProxyTest.class.php	2008-07-08 21:18:15 UTC (rev 7101)
@@ -54,28 +54,6 @@
     $this->assertEqual($proxy->create_calls, 1);
   }
 
-  function testGetHashDontResolveProxy()
-  {
-    $wrapped = new lmbObject();
-    $proxy = new ProxyTestingStub($wrapped);
-
-    $this->assertNotEqual($proxy->getHash(), $wrapped->getHash());
-    $this->assertEqual($proxy->create_calls, 0);
-  }
-
-  function testGetHash()
-  {
-    $wrapped = new lmbObject();
-    $proxy = new ProxyTestingStub($wrapped);
-
-    $this->assertNotEqual($proxy->getHash(), $wrapped->getHash());
-
-    $proxy->changed = true;
-
-    $this->assertEqual($proxy->getHash(), $wrapped->getHash());
-    $this->assertEqual($proxy->create_calls, 1);
-  }
-
   function testGetClass()
   {
     $wrapped = new lmbObject();



More information about the limb-svn mailing list