Changeset 510

Show
Ignore:
Timestamp:
04/14/07 11:55:50 (1 year ago)
Author:
mikey
Message:

test for bugfix: do not reserialize if it was not unserialized before

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/test/php/net/stubbles/stubSerializedObjectTestCase.php

    r498 r510  
    141141        $this->assertEqual($stub3d->getBar(), 909); 
    142142    } 
     143     
     144    /** 
     145     * test against bug: ensure that the integrity of the serialized object 
     146     * is maintained over several serialize/unserialize operations 
     147     */ 
     148    public function testSerializationIntegrity() 
     149    { 
     150        $this->stubBaseObject->setBar(808); 
     151        $foo = serialize($this->serializedObject); 
     152        $bar = unserialize($foo); 
     153        $baz = serialize($bar); 
     154        $test = unserialize($baz); 
     155        $baseObject = $test->getUnserialized(); 
     156        $this->assertIsA($baseObject, 'stub3stubBaseObject'); 
     157        $this->assertEqual($baseObject->getBar(), 808); 
     158    } 
    143159} 
    144160?>